From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17717 invoked by alias); 22 Aug 2008 16:29:50 -0000 Received: (qmail 17708 invoked by uid 22791); 22 Aug 2008 16:29:49 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 22 Aug 2008 16:28:36 +0000 Received: from wpaz37.hot.corp.google.com (wpaz37.hot.corp.google.com [172.24.198.101]) by smtp-out.google.com with ESMTP id m7MGSRAT030370; Fri, 22 Aug 2008 17:28:27 +0100 Received: from [172.16.9.2] (simonb.lon.corp.google.com [172.16.9.2]) by wpaz37.hot.corp.google.com with ESMTP id m7MGSPJ4019235; Fri, 22 Aug 2008 09:28:26 -0700 Message-ID: <48AEE929.8030506@google.com> Date: Fri, 22 Aug 2008 16:53:00 -0000 From: Simon Baldwin User-Agent: Thunderbird 1.5.0.14ubu (X11/20080502) MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org CC: Tom Tromey Subject: Re: [PATCH][RFC] -Wno-... option to suppress builtin macro redefined warnings Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2008-08/txt/msg01683.txt.bz2 Simon Baldwin wrote: > Simon Baldwin wrote: >> Tom Tromey wrote: >>>>>>>> "Simon" == Simon Baldwin writes: >>>>>>>> >>> >>> ... >>> However, it seems to me that we would want to allow redefinition of >>> some macros (__TIME__ et al) but not others (e.g., __LINE__). >>> >>> So, how about splitting builtin_array into two pieces (and just FYI, >>> there's a comment above referring to "two tables" that should be >>> changed) and then unconditionally setting NODE_WARN for one table but >>> not the other? Or, just adding a special case in the builtin >>> definition loop for the BT_* constants we care to allow. >>> >> >> Thank you for the note. >> >> I guess that in general it just seems more, um, seamless to either >> allow or disallow any builtin macro to be redefined. It means that >> there's no "is it redefinable or not?" decision to be made when new >> builtins are added. It also neatly sidesteps the issue of then >> having to document which builtins are redefinable and which aren't >> (also no update to this doc should new builtins be added), or having >> to deal with requests to move builtins between redefinable/fixed >> groups. In other words, the lowest impact on future code maintainers >> consistent with low impact on current code. >> >> Granted, somebody could well redefine __LINE__ or similar and make a >> mess of compilation, but there are of course plenty of other ways to >> make a mess of compilation with other gcc flags. >> -Wno-builtin-macro-redefined is aimed at the control-freak automated >> build system rather than the casual user, so it seemed okay, to me >> anyway, for it to bear closer resemblance to a chainsaw than to a >> scalpel. >> >> That said, I'm not wildly opposed to creating two "classes" of >> builtin. It just seems like doing so might sow slightly more >> confusion than it prevents. > > Tom, any further thoughts on this? > > It's certainly not hard to split built-in macros into two tiers, those > where redefinition warning can be suppressed by providing > -Wno-builtin-macro-redefined, and those where it can't. However, > since it's all just about suppressing a warning, it may be that one > policy to cover all of them will suffice, and be simpler to manage and > maintain. > > Thanks. > No response from Tom to date. Would anyone else be prepared to pick this up in the interim? Thanks. -- Google UK Limited | Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W 9TQ | Registered in England Number: 3977902