From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101222 invoked by alias); 20 Sep 2015 18:18:52 -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 101212 invoked by uid 89); 20 Sep 2015 18:18:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 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-f174.google.com Received: from mail-wi0-f174.google.com (HELO mail-wi0-f174.google.com) (209.85.212.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sun, 20 Sep 2015 18:18:50 +0000 Received: by wicge5 with SMTP id ge5so89040491wic.0 for ; Sun, 20 Sep 2015 11:18:47 -0700 (PDT) X-Received: by 10.180.93.196 with SMTP id cw4mr9773416wib.54.1442773127483; Sun, 20 Sep 2015 11:18:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.186.214 with HTTP; Sun, 20 Sep 2015 11:18:08 -0700 (PDT) In-Reply-To: References: From: =?UTF-8?B?TWFudWVsIEzDs3Blei1JYsOhw7Fleg==?= Date: Sun, 20 Sep 2015 18:23: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-09/txt/msg01493.txt.bz2 PING^2: https://gcc.gnu.org/ml/gcc-patches/2015-07/msg02414.html On 21 August 2015 at 19:41, Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez wrote: > Any comments on this? https://gcc.gnu.org/ml/gcc-patches/2015-07/msg02414= .html > > 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 = welcome. >> >> Cheers, >> >> Manuel.