Everything is in the title, I searched a lot but cannot find what is the standard that uses my compiler is it C89 C90 C99 or C11 ... I mean when we do not specify the -std option ( the default one) ?
When in doubt, consult the documentation. The gcc man-page makes it clear that -std=gnu89
is the default for C code, and -std=gnu++98
is the default for C++ code. The meaning of these options is described both in the man page and, in much more detail, in the extensive info documentation that is also available online.
These defaults for these flags have changed before and will change again, so it is best to check before assuming specific values.
UPDATE
The defaults have changed over the years. As of GCC 8.3.0, released in February 2019, the default standard for C is -std=gnu11
, and -std=gnu++14
for C++. To be sure, look at the documentation of the compiler version you are actually using.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With