19

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~

sam
  • 2,049
  • 3
  • 20
  • 27
  • There's a recent question related to the c++ part of your question [here](http://stackoverflow.com/questions/10026150/what-c-norme-im-currently-using/) – juanchopanza Apr 05 '12 at 13:31
  • 1
    This page may summarize what u need. https://gcc.gnu.org/projects/cxx-status.html – Gimhani Aug 28 '18 at 06:00

5 Answers5

17

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.

Kerrek SB
  • 464,522
  • 92
  • 875
  • 1,084
9

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.

Tamás Szelei
  • 23,169
  • 18
  • 105
  • 180
  • I can see many standard gcc and g++ supported in the webpage you provide. And where is the information about which gcc and g++ version support which standards? Thank you~ – sam Apr 05 '12 at 13:32
  • I don't think there is such information available, and if there were you would get mostly the same possible values for `-std`. It think the latest addition was "c++0x" in 4.3. Standards and their implementation in GCC are two different things. What do you call "support"? Even with the latest version, GCC still added fixes to C++03 and that standard is almost 10 years old (to be pedantic, most of it was the same as c++98, so it's even older). – Tamás Szelei Apr 05 '12 at 13:58
  • Thank you~I can understand the difference. And what is the case of using -fpermissive? – sam Apr 05 '12 at 14:03
  • 1
    `-fpermissive` allows nonstandard code to compile. There are several instances where a code is not standard but the meaning of it can be still understood by the compiler. Normally such code is rejected, but you can get more relaxed rules with this option. The normal use-case is when you need to keep compatibility with legacy code. For example, the two-phase lookup change (actually fix) can break existing code, but `-fpermissive` will apply the previous rules. – Tamás Szelei Apr 05 '12 at 15:01
4

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

2

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

0

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