There are some extensions in the GNU g++ compilers such as VLA (variable length arrays), even though those features are not C++ standards.
So if I need to compile a program using only C++ standard constructs and avoiding those extra extensions, can I do it with GNU g++?
Something like g++ test.cpp -std=onlyStandards
?
Pass the
-pedantic-errors
flag. Be sure to set a standard with-std=
, such as-std=c++14
. This works in clang as well.