Which gcc and g++ version support which standard of c and c++?

China☆狼群 提交于 2019-12-03 23:35:50

问题


For example, which gcc version support c99?

Is there any table or graph to show the standard supported status of gcc and g++?

How gcc and g++ evolved?

Thank you~


回答1:


Very strictly speaking, GCC only supports C89, C++98 and C++03, all for sure since 4.3.

Support for C99 is still incomplete as of yet, but a very large and usable subset has been supported by GCC for a long time.

Experiemental C++11 support started with 4.3 and has been improving ever since; it's already very usable in 4.6.x, and a lot more has been added in 4.7 (though 4.7.0 is a bit unstable).

There is also some C11 support, but many of the changes for C11 require a suitably new C library, which is not so easily replaceable.




回答2:


You get the widest support of standards with the latest version - 4.7 at the moment. The chosen standard can be set with the -std switch. Here is an article that describes the available values. Some additional features/different behavior can also be enabled with -fpermissive.




回答3:


See http://gcc.gnu.org/projects/cxx0x.html




回答4:


I suppose this table is useful, too: cppreference compiler support page




回答5:


The support details can be found at gnu website. I remember that there're about dozens standards that gcc doesn't apply for the c99. Anyway, to have c99 support in gcc just needs simple --std=c99 parameter



来源:https://stackoverflow.com/questions/10029437/which-gcc-and-g-version-support-which-standard-of-c-and-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!