5 messages in com.mysql.lists.plusplusRe: gcc won't compile 2.3.1 with -Wal...
FromSent OnAttachments
Andrew Sayers11 Jul 2007 08:58 
Warren Young11 Jul 2007 11:12 
Jonathan Wakely11 Jul 2007 12:26 
Warren Young11 Jul 2007 13:00 
Jonathan Wakely11 Jul 2007 13:22 
Subject:Re: gcc won't compile 2.3.1 with -Wall -Wextra -pedantic
From:Jonathan Wakely (mys@kayari.org)
Date:07/11/2007 01:22:15 PM
List:com.mysql.lists.plusplus

On 11/07/07, Warren Young <mysq@etr-usa.com> 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