From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 45065 invoked by alias); 21 Aug 2015 17:42:00 -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 45045 invoked by uid 89); 21 Aug 2015 17:41:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 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-f181.google.com Received: from mail-wi0-f181.google.com (HELO mail-wi0-f181.google.com) (209.85.212.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 21 Aug 2015 17:41:58 +0000 Received: by wicne3 with SMTP id ne3so21564999wic.0 for ; Fri, 21 Aug 2015 10:41:55 -0700 (PDT) X-Received: by 10.180.223.4 with SMTP id qq4mr7753844wic.54.1440178915701; Fri, 21 Aug 2015 10:41:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.188.198 with HTTP; Fri, 21 Aug 2015 10:41:16 -0700 (PDT) In-Reply-To: References: From: =?UTF-8?B?TWFudWVsIEzDs3Blei1JYsOhw7Fleg==?= Date: Fri, 21 Aug 2015 17:44:00 -0000 Message-ID: Subject: Re: [RFC PATCH] parse #pragma GCC diagnostic in libcpp To: Gcc Patch List Cc: "Joseph S. Myers" , Jason Merrill , Dodji Seketeli , Marek Polacek Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SW-Source: 2015-08/txt/msg01340.txt.bz2 Any comments on this? https://gcc.gnu.org/ml/gcc-patches/2015-07/msg02414.h= tml I don't see any other way to fix these PRs, but I don't know how to keep the pragmas from being deleted by the preprocessor. Cheers, Manuel. On 29 July 2015 at 00:46, Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez wrote: > Currently, #pragma GCC diagnostic is handled entirely by the FE. This > has several drawbacks: > > * PR c++/53431 - C++ preprocessor ignores #pragma GCC diagnostic: The > C++ parser lexes (and preprocesses) before handling the pragmas. > > * PR 53920 - "gcc -E" does not honor #pragma GCC diagnostic ignored > "-Wunused-macro": Because -E does not invoke the FE code that parses > the FE pragmas. > > * PR 64698 - preprocessor ignores #pragma GCC diagnostic when using > -save-temps. Same issue as above. > > The following patch moves the handling of #pragma GCC diagnostic to > libcpp but keeps the interface with the diagnostic machinery in the FE > by using a call-back function. > > One serious problem with this approach is that the preprocessor will > delete the pragmas from the preprocessed output, thus '-E', > '-save-temps' will not contain the pragmas and compiling the > preprocessed file will trigger the warnings that they were meant to > suppress. Any ideas how to prevent libcpp from deleting the #pragmas? > > No Changelog since this is not a request for approval, but comments are w= elcome. > > Cheers, > > Manuel.