[PATCH][RFC] -Wno-... option to suppress builtin macro redefined warnings
Simon Baldwin
simonb@google.com
Tue Aug 26 18:38:00 GMT 2008
Tom Tromey wrote:
>>>>>> "Simon" == Simon Baldwin <simonb@google.com> writes:
>>>>>>
>
> Simon> Tom, any further thoughts on this?
>
> Simon> It's certainly not hard to split built-in macros into two tiers,
> Simon> those where redefinition warning can be suppressed by providing
> Simon> -Wno-builtin-macro-redefined, and those where it can't. However,
> Simon> since it's all just about suppressing a warning, it may be that one
> Simon> policy to cover all of them will suffice, and be simpler to manage
> Simon> and maintain.
>
>
> Simon> No response from Tom to date.
>
> Sorry, I had a bit of a mail problem and missed a few things.
>
> I think that, as a rule of thumb, we should only relax existing
> pedantic checks for a good reason. My thinking here is that, in the
> past, we've had bad experiences with relaxing these rules, and so it
> is best to defer it as long as we possibly can.
>
> In this case, I can understand wanting to override date or time
> macros. However, I couldn't think of a scenario where it would make
> sense to modify __LINE__. So, I still think it would be better to
> separate the cases. I don't think the maintenance burden is a major
> problem.
>
> Perhaps some other GCC maintainer would care to weigh in.
>
Nothing additional so far...
...so, attached below is a re-draft of this patch to bifurcate built-in
macros so that only TIMESTAMP, TIME, DATE, FILE, and FILE_BASE are
affected by -Wno-builtin-macro-redefined, and other built-in macros
always warn if redefined.
Please take another look when time permits, to see if you like this
version better than the first. And thanks again for the feedback.
--S
--
Google UK Limited | Registered Office: Belgrave House, 76 Buckingham
Palace Road, London SW1W 9TQ | Registered in England Number: 3977902
-------------- next part --------------
A non-text attachment was scrubbed...
Name: builtin-redefined.patch
Type: text/x-patch
Size: 12237 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080826/b5555b0f/attachment.bin>
More information about the Gcc-patches
mailing list