New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[basic.fundamental]p4 misquotes C #3310
Comments
The C++ specification generally does not rely on the C core language specification. (The C standard library is incorporated by reference, but the C++ core language specification is standalone.) The purpose of this reference to C is to point out the intentional difference between the two languages. This should be clarified if it's causing confusion. |
I think it is a bit confusing -- it reads a bit like "padding bits cannot have traps, see C for rationale". Maybe it could be clarified with:
and add a compatibility entry to Annex C.1 since this is a difference in behaviors between the two languages? |
He did, he said [basic.fundamental]p4. |
@AaronBallman, Annex C.1 lists situations where a valid C program may change semantics or be ill-formed when compiled as C++. The situation here is not such a case, since we are changing from trap (undefined behavior) to well-defined behavior. |
We currently say
Should we instead say "In contrast, see ISO C 6.2.6.2." ? |
Okay, that's a fair point.
That would clarify it for me, yes. |
The note in [basic.fundamental]p4 (http://eel.is/c++draft/basic.fundamental#4.sentence-5) is incorrect if it's relying on the C standard to provide that guarantee. The C standard states that padding bits can cause trap representations. See C17 footnote 53:
The text was updated successfully, but these errors were encountered: