I’m compiling C++ code and I’d like to enable the -pedantic option.
I’m using GCC 4.0, running Xcode on Mac OS X Leopard.
It is for example possible to allow variadic macros and the long long type that are normally forbidden when using -pedantic (with -Wno-variadic-macros and -Wno-long-long).
But I could not find anything to disable the “comma at end of enumerator list” warning.
Is it possible?
Thanks.
A comma at the end of an enumerator is valid in C99 but not in C89, so the following will work providing your code is valid C99
I’m fairly sure that it’s not valid in C++ (according to g++) at all
Edit: tested this with GCC 4.2.1 on HP-UX and it works with no errors / warnings
foo.c