From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22305 invoked by alias); 20 Sep 2004 22:59:06 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 22294 invoked from network); 20 Sep 2004 22:59:04 -0000 Received: from unknown (HELO lon-mail-2.gradwell.net) (193.111.201.126) by sourceware.org with SMTP; 20 Sep 2004 22:59:04 -0000 Received: (qmail 4902 invoked from network); 20 Sep 2004 22:59:03 -0000 Received: from digraph.polyomino.org.uk (postmaster%pop3.polyomino.org.uk@81.187.227.50) by lon-mail-2.gradwell.net with SMTP; 20 Sep 2004 22:59:03 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.41) id 1C9X7e-0006kW-Uf; Mon, 20 Sep 2004 22:59:02 +0000 Date: Mon, 20 Sep 2004 23:42:00 -0000 From: "Joseph S. Myers" X-X-Sender: jsm28@digraph.polyomino.org.uk To: Matt Austern cc: Mark Mitchell , gcc@gcc.gnu.org, Dale Johannesen , Nathan Sidwell , Jason Merrill Subject: Re: DR handling for C++ In-Reply-To: <4FFC8911-0B47-11D9-ADB7-000A95AA5E5E@apple.com> Message-ID: References: <414F37E0.3020509@codesourcery.com> <79845B6C-0B44-11D9-8A65-000A95D7CD40@apple.com> <414F412C.90504@codesourcery.com> <4FFC8911-0B47-11D9-ADB7-000A95AA5E5E@apple.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2004-09/txt/msg01204.txt.bz2 On Mon, 20 Sep 2004, Matt Austern wrote: > Isn't the fundamental problem that we're using pedwarns differently in the C > and C++ front ends? In the C front end you don't even see pedwarns unless you > use a special compiler flag, and making them into errors requires an even more > special compiler flag. It's very odd that it means something so different in > the C++ front end. If pedwarn() is executed, you see the diagnostic, for both C and C++ - no special flag is required. -pedantic is only relevant to if (pedantic) pedwarn (...). Every case where "pedantic" is checked represents some form of extension. Every such case should be documented as an extension, or the conditioning on pedantic removed. pedwarn() is used where the standard requires a diagnostic but it hasn't been decided to make the relevant condition a hard error (or, in C++, it has been decided to permit the relevant condition under -fpermissive). Such cases should all also be documented (with details of the semantics assigned to the cases which the standard says are ill-formed but we permit) or removed (changed to hard errors). (There may also be some cases where the standard permits the code to be rejected but does not require a diagnostic, where pedwarn() has been chosen.) In both cases, and for both C and C++, one can document or remove any individual extension without needing to do all the others at the same time. The name pedwarn() has been a bit confusing (because it suggests a link to -pedantic which isn't really there, the link being that -pedantic-errors turns pedwarns from warnings to errors), but I don't have a good suggestion for a less confusing name. -- Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/ http://www.srcf.ucam.org/~jsm28/gcc/#c90status - status of C90 for GCC 4.0 jsm@polyomino.org.uk (personal mail) jsm28@gcc.gnu.org (Bugzilla assignments and CCs)