开发者

Do any c compilers implement any of the C1X features?

Do any c compilers implement any of the C1X features?

P.S.:Is there a way 开发者_StackOverflow社区to emulate some of these features in current c compilers


GCC 4.6 has some experimental support for C1X features:

There is now experimental support for some features from the upcoming C1X revision of the ISO C standard. This support may be selected with -std=c1x, or -std=gnu1x for C1X with GNU extensions. Note that this support is experimental and may change incompatibly in future releases for consistency with changes to the C1X standard draft. The following features are newly supported as described in the N1539 draft of C1X (with changes agreed at the March 2011 WG14 meeting); some other features were already supported with no compiler changes being needed, or have some support but not in full accord with N1539 (as amended).

  • Static assertions (_Static_assert keyword)
  • Typedef redefinition
  • New macros in <float.h>
  • Anonymous structures and unions


Besides gcc, clang has started to add support for C1x features. In particular, there is support for _Generic and _Static_assert. Some other features may be implemented as well, but I haven't tried them.


Based on perusal of the lists and the gcc testsuite (ls gcc/gcc/testsuite/gcc.dg/c1x*):

  • I looks like _Noreturn is coming in gcc-4.7.
  • From the testsuite it looks like unicode strings will be too.
  • It also looks like CMPLX macros are being worked on too.
  • Maybe _Generic is coming in gcc-4.8.


You may want to check Pelles C out (Only availble for Windows).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜