On 11/07/07, Warren Young <mysqlpp@stripped> wrote:
>
> Thanks for the moral support. I'm leaning toward just turning on an
> STFU pragma around that code.
Unfortunately GCC doesn't have any pragmas for turning warnings or
errors on and off like that, they're controlled by the command-line
only, and they affects the whole translation unit. (There is a project
underway to provide more fine-grained control but that doesn't help
now.)
Neither is there a macro that tells you when -pedantic has been
requested. And even in the latest development compiler's C++0x mode
this is still an error.
Tough call - if you want the library to be usable with -pedantic
(which is a reasonable feature for people to request) then you'll have
to forego the trailing comma :-(
This layout
enum { foo
, bar
, baz
};
helps prevent the same copy'n'paste errors, but isn't to everyone's
taste (although it does work in other lists, not just enum
declarations, which is why some people use it.)
Jon