在C11最新的变化 [英] Latest changes in C11

查看:268
本文介绍了在C11最新的变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C1X已成为ISO / IEC 9899:2011又名C11

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

有谁知道什么变化(如果有的话)中有标准从的 2011年4月n1570草案的?

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

ETA:有从伦敦(2011年3月)的委员会会议记录(其中应包括在n1570)的here ,从华盛顿特区(2011年10月)的此处;我想在DC分钟接受的更改应涵盖事情的清单。

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.

推荐答案

我今天刚刚得知有一个(有点)N1570和最终的C11标准之间显著的变化(ISO / IEC 9899:2011(E))。

I just learned today that there was one (somewhat) significant change between N1570 and the final C11 standard (ISO/IEC 9899:2011 (E)).

在N1570,6.3.2p3说:

In N1570, 6.3.2p3 says:

除非它是的sizeof 运算符的操作数,则 _Alignof
  经营者或一元&安培; 运营商,或者是一个字符串用来
  初始化数组,有键入前pression的阵列的键入的被
  转换成一个前pression,类型为指针的键入的即点
  到数组对象和初始元素不是左值。

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.

列入 _Alignof 是一个错误,因为的语法的单目前pression 的许可

The inclusion of _Alignof was an error, since the syntax of a unary-expression permits

_Alignof ( type-name )

而不是

_Alignof unary-expression

释放的C11标准纠正这个错误,并恢复到C99的写法:

The released C11 standard corrects this error and reverts to the C99 wording:

除非它是的sizeof 运算符的操作数,或
  一元&安培; 运营商,或者是用于初始化数组文本字符串,
  有型的前pression的阵列的键入的转换为
  前pression,类型为指针的键入的指向初始
  该数组对象和元素不是左值。

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.

更多信息:在最近发布到comp.std.c关于N1570和发布的标准,拉里·琼斯ISO C委员会成员之间的差异,这样写道:

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:

有一些人,但大多数都只是小的编辑调整,
  更改样板文本,并围绕洗牌的东西,以保持
  这是幸福的权力。最大的变化是从去除_Alignof
  它不应该被加入地方束(基于错误
  概念,它需要无论是类型或一个前pression喜欢做的sizeof
  当它真的只需要一个类型):6.3.2.1p2,P3,P4,FN。 65;和
  6.7.1 FN。 121。

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.

邮件ID:< rfg33a-u0q.ln1@jones.homeip.net>

下面的作为上看到groups.google线程。 COM。

这篇关于在C11最新的变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆