Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Latest changes in C11

Tags:

c

standards

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.

like image 355
J. C. Salomon Avatar asked Dec 25 '11 19:12

J. C. Salomon


People also ask

What changed in C++11?

The C++11 Standard Library was also revamped with new algorithms, new container classes, atomic operations, type traits, regular expressions, new smart pointers, async() facility, and of course a multithreading library. A complete list of the new core and library features of C++11 is available here.

Should I use C11 or C99?

It is best to use C11 as that is the current standard. C99 and C11 both contained various "language bug fixes" and introduced new, useful features.

Is C11 newer than C99?

C11 (formerly C1X) is an informal name for ISO/IEC 9899:2011, a past standard for the C programming language. It replaced C99 (standard ISO/IEC 9899:1999) and has been superseded by C17 (standard ISO/IEC 9899:2018).


1 Answers

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.

like image 84
Keith Thompson Avatar answered Sep 22 '22 19:09

Keith Thompson