If I don’t specify the -std
option when compiling my C++ app using GCC4.8.1,
does it apply c++11 value by default?
I read the words from GCC document, but still not sure of that. My English is not good, so it might be my bad.
-fext-numeric-literals (C++ and Objective-C++ only) Accept imaginary, fixed-point, or machine-defined literal number suffixes as GNU extensions. When this option is turned off these suffixes are treated as C++11 user-defined literal numeric suffixes. This is on by default for all pre-C++11 dialects and all GNU dialects: -std=c++98, -std=gnu++98, -std=gnu++11, -std=gnu++1y. This option is off by default for ISO C++11 onwards (-std=c++11, ...).
Update in 2018: in the newest version of gcc, the default option for -std
is now -std=gnu++14
.
From gcc standards 2.2 C++ language
The default, if no C++ language dialect options are given, is -std=gnu++98.
So if you want to enable C++11 features, you have to add the option -std=c++11
or -std=gnu++11
(for C++11 with GNU extensions)
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