If I use gcc -std=c17
, will -Wpedantic
issue warnings for c17? Is this the same as ISO C?
Yes, in general the -std=cxx
picks the C standard to follow, and is somewhat similar to the default -std=gnuxx
setting, except the latter enables various language extensions. Basically this options picks which language features that will be available, but doesn't otherwise tell the compiler to be strict about it.
-Wpedantic-
/-pedantic-errors
is what makes the compiler strict. -std=c17 -Wpedantic
will turn it into a strict (mostly) ISO C compliant compiler. It will remove various non-standard extensions from standard headers and also give diagnostic messages when you attempt various non-standard features. There are a few scenarios here and there where gcc fails to conform to the standard even in strict mode, but mostly it has very good conformance when these options are enabled.
Clang and icc compilers use the same settings too.