public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/53431] C++ preprocessor ignores #pragma GCC diagnostic
Date: Fri, 05 Sep 2014 17:42:00 -0000	[thread overview]
Message-ID: <bug-53431-4-HrxGEPLPoI@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-53431-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431

--- Comment #9 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Manuel López-Ibáñez from comment #5)
> The C++ parser lexes (and preprocesses) before handling the pragmas, whereas
> the C parser processes the pragmas as it sees them.
> 
> We must somehow parse these pragmas *also* in cp/parser.c:631. Maybe one can
> do something similar to what we do for cp_parser_initial_pragma, but within
> the loop and only handling pragma diagnostic. Surely, it will need some
> trial and error to get it right. If any of you wants to give it a try and
> need some help, just ask here or in the mailing list.

There are two problems that need fixing to implement this:

1. At the point the pragma is lexed we don't know that this is pragma GCC
diagnostic, since the pragmas are registered dynamically and there is no (enum
pragma_kind) PRAGMA_GCC_DIAGNOSTIC. Perhaps one could do what is done for
PRAGMA_GCC_PCH_PREPROCESS.

2. The second problem is that handle_pragma_diagnostic does not work during
lexing (at least for C++). We would need to rewrite the whole function and call
it directly.
>From gcc-bugs-return-461319-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Sep 05 17:57:46 2014
Return-Path: <gcc-bugs-return-461319-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 25263 invoked by alias); 5 Sep 2014 17:57:45 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 25226 invoked by uid 48); 5 Sep 2014 17:57:42 -0000
From: "dominiq at lps dot ens.fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/63188] [5 Regression] r214954 breaks bootstrap on x86_64-apple-darwin13
Date: Fri, 05 Sep 2014 17:57:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: bootstrap
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: blocker
X-Bugzilla-Who: dominiq at lps dot ens.fr
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-63188-4-F8aQNeVrXy@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63188-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63188-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-09/txt/msg01153.txt.bz2
Content-length: 555

https://gcc.gnu.org/bugzilla/show_bug.cgi?idc188

--- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Bootstrap of revision r214972 with the patch

--- ../_clean/gcc/config/darwin.h    2014-06-27 18:25:13.000000000 +0200
+++ gcc/config/darwin.h    2014-09-05 18:28:29.000000000 +0200
@@ -499,7 +499,7 @@ extern GTY(()) int darwin_ms_struct;
 #define NO_PROFILE_COUNTERS    1

 #undef    INIT_SECTION_ASM_OP
-#define INIT_SECTION_ASM_OP
+#define INIT_SECTION_ASM_OP ""

 #undef    INVOKE__main

just completed, testing in progress.


  parent reply	other threads:[~2014-09-05 17:42 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-21  8:03 [Bug c++/53431] New: C++ preprocessor ignores #pragma GCC diagnostic ignored "-Wundef" ml.lattuada at libero dot it
2013-02-17 17:04 ` [Bug c++/53431] " rainarchitect at gmail dot com
2013-03-03  4:10 ` markus at oberhumer dot com
2013-07-12  9:20 ` nomegenerico at email dot it
2013-11-16 18:13 ` rainarchitect at gmail dot com
2013-11-16 19:51 ` manu at gcc dot gnu.org
2013-11-16 20:23 ` manu at gcc dot gnu.org
2014-09-05 17:42 ` manu at gcc dot gnu.org [this message]
2015-06-03  8:27 ` [Bug c++/53431] C++ preprocessor ignores #pragma GCC diagnostic manu at gcc dot gnu.org
2015-07-20  9:38 ` manu at gcc dot gnu.org
2015-07-22  0:00 ` noloader at gmail dot com
2015-07-22 10:51 ` redi at gcc dot gnu.org
2015-07-22 11:24 ` noloader at gmail dot com
2015-07-23 10:34 ` noloader at gmail dot com
2015-07-23 10:47 ` redi at gcc dot gnu.org
2015-07-23 11:32 ` manu at gcc dot gnu.org
2015-07-23 13:20 ` manu at gcc dot gnu.org
2015-07-23 23:26 ` noloader at gmail dot com
2015-07-30 17:22 ` miyuki at gcc dot gnu.org
2021-02-27 11:24 ` noloader at gmail dot com
2021-06-03 12:04 ` redi at gcc dot gnu.org
2021-10-06 14:40 ` jakub at gcc dot gnu.org
2021-12-01 17:43 ` egallager at gcc dot gnu.org
2021-12-04 17:48 ` lhyatt at gcc dot gnu.org
2021-12-19 11:55 ` pinskia at gcc dot gnu.org
2021-12-19 19:50 ` manu at gcc dot gnu.org
2021-12-24 21:29 ` lhyatt at gcc dot gnu.org
2022-03-23  0:58 ` pinskia at gcc dot gnu.org
2022-05-25 13:38 ` lhyatt at gcc dot gnu.org
2022-06-29 16:08 ` lhyatt at gcc dot gnu.org
2022-07-06 19:40 ` cvs-commit at gcc dot gnu.org
2022-07-06 19:42 ` lhyatt at gcc dot gnu.org
2022-07-06 22:59 ` lhyatt at gcc dot gnu.org
2022-11-08 22:28 ` redi at gcc dot gnu.org
2022-11-09  0:05 ` markus at oberhumer dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-53431-4-HrxGEPLPoI@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).