Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Does the committee have any plans to document the rationale for each kind of Undefined Behavior?

Does the committee have any plans to make NULL pointer arguments to memcpy non-UB when the size argument is 0?



> Does the committee have any plans to document the rationale for each kind of Undefined Behavior?

In the C99 timeframe, we had a rationale document that was separately maintained. My understanding (this predates my joining the committee) is that this was prohibitively labor-intensive and so we stopped doing it for C11. I don't know of any plans to start doing this again, even in a limited sense for justifying UB. That said, we do spend time considering whether an aspect of a proposal requires UB or not, so the rationale exists in the proposals and committee minutes.

> Does the committee have any plans to make NULL pointer arguments to memcpy non-UB when the size argument is 0?

I have not seen such a proposal, and suspect that implementations may be concerned about losing their optimization opportunities from such a change. (Personally, I'd be okay losing those optimization opportunities as this does not seem like a situation where UB is necessary.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: