Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
462 views
in Technique[技术] by (71.8m points)

c - Latest changes in C11

C1x has become ISO/IEC 9899:2011 aka C11.

Does anyone know what changes (if any) there are in the Standard from the April 2011 draft n1570?

ETA: There are the Committee minutes from London (March 2011) (which should be included in n1570) here, and from Washington, DC (October 2011) here; I suppose a list of accepted changes in the DC minutes should cover things.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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: <rfg33a-u0q.ln1@jones.homeip.net>

Here's the thread as seen on groups.google.com.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...