From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22400 invoked by alias); 17 Oct 2014 17:04:21 -0000 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 Received: (qmail 22390 invoked by uid 89); 17 Oct 2014 17:04:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f182.google.com Received: from mail-wi0-f182.google.com (HELO mail-wi0-f182.google.com) (209.85.212.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 17 Oct 2014 17:04:18 +0000 Received: by mail-wi0-f182.google.com with SMTP id n3so1798305wiv.3 for ; Fri, 17 Oct 2014 10:04:16 -0700 (PDT) X-Received: by 10.194.23.104 with SMTP id l8mr11754090wjf.26.1413565455905; Fri, 17 Oct 2014 10:04:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.217.80.73 with HTTP; Fri, 17 Oct 2014 10:03:55 -0700 (PDT) From: =?ISO-8859-1?Q?Manuel_L=F3pez=2DIb=E1=F1ez?= Date: Fri, 17 Oct 2014 17:08:00 -0000 Message-ID: Subject: C/C++ diagnostics guidelines (was: Re: [C PATCH] Enable initializing statics with COMPOUND_LITERAL_EXPR in C99 (PR c/63567)) To: Gcc Patch List , "Joseph S. Myers" , Marek Polacek , Paolo Carlini , Jason Merrill , Dodji Seketeli , Jonathan Wakely Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2014-10/txt/msg01769.txt.bz2 > The Right Thing is for -pedantic not to cause errors, only warnings > (-pedantic-errors being needed for an error). So rather than having this > conditional for whether to allow the extension at all, make the > conditional code do a pedwarn (if flag_isoc99, otherwise there will > already have been one for using a compound literal at all, and not for > VECTOR_TYPE). (I don't believe this can affect the semantics of valid > code; in this case of require_constant with a compound literal, we know > the code is invalid in ISO C terms, so it's safe to diagnose it then > interpret it in a sensible way.) I think there is roughly consensus about how C/C++ diagnostics should work, but it is easy to forget it since it is not really written anywhere. Thus, I drafted some guidelines at:https://gcc.gnu.org/wiki/Better_Diagnostics#guidelines Please, could you take a look and comment whether I got it right/wrong? New items are very welcome! Cheers, Manuel.