I just learned today that there was one (somewhat) significant change between N1570 and the final C11 standard (ISO/IEC 9899:2011 (E)).
In N1570, 6.3.2p3 says:
Except when it is the operand of the sizeof
operator, the _Alignof
operator, or the unary &
operator, or is a string literal used to
initialize an array, an expression that has type "array of type" is
converted to an expression with type "pointer to type" that points
to the initial element of the array object and is not an lvalue.
The inclusion of _Alignof
was an error, since the syntax of a unary-expression permits
_Alignof ( type-name )
but not
_Alignof unary-expression
The released C11 standard corrects this error and reverts to the C99 wording:
Except when it is the operand of the sizeof
operator, or the
unary &
operator, or is a string literal used to initialize an array, an
expression that has type "array of type" is converted to an
expression with type "pointer to type" that points to the initial
element of the array object and is not an lvalue.
More information: in a recent posting to comp.std.c about differences between N1570 and the released standard, Larry Jones, a member of the ISO C committee, wrote:
There are a number of them, but most are just minor editorial tweaks,
changes to boilerplate text, and shuffling things around to keep the
powers that be happy. The biggest change was removing _Alignof from a
bunch of places it shouldn't have been added (based on the erroneous
notion that it takes either a type or an expression like sizeof does
when it really only takes a type): 6.3.2.1p2, p3, p4, fn. 65; and
6.7.1 fn. 121.
Message-ID: <[email protected]>
Here's the thread as seen on groups.google.com.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…