GCC: Is it possible to disable the "comma at end of enumerator list" warning when using -pedantic?
enums, gcc
Solution
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
gcc -std=c99 -pedantic foo.c
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
int main(int argc, char** argv) {
enum { A, B, };
return 0;
}
gcc -std=c99 -pedantic foo.c
Problem
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.