public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/61593] Support '#pragma mark - foo' on non-Darwin targets (by simply ignoring it without warning)
Date: Fri, 04 Nov 2022 20:29:24 +0000	[thread overview]
Message-ID: <bug-61593-4-U10m7DNxJy@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61593-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #13 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Eric Gallager from comment #5)
> It should be pretty easy; in config/darwin.h #pragma mark is registered as
> part of the DARWIN_REGISTER_TARGET_PRAGMAS() macro like this:
> 
> if (!flag_preprocess_only)					\
>       cpp_register_pragma (parse_in, NULL, "mark",		\
> 			   darwin_pragma_ignore, false);
> 
> ...and then darwin_pragma_ignore() is a simple no-op declared in
> config/darwin-protos.h and defined in config/darwin-c.c. So I guess it'd
> just have to be re-titled and moved somewhere generic?

I looked into doing this as a follow-up to my PR 85487 patch. However, the
definition of c_register_pragma in gcc/c-family/c-pragma.cc says:

/* Front-end wrappers for pragma registration to avoid dragging
   cpplib.h in almost everywhere.  */

So I don't think we want to include cpplib.h in that file, which means that it
can't make the same call to cpp_register_pragma.

I don't know the reason for treating that pragma differently from the others
(this appears to be the only use of cpp_register_pragma in the whole of GCC!),
so I don't want to change it. That means I won't be tackling this one myself.

Maybe it could just use c_register_pragmas, or maybe including cpplib.h in
c-pragma.cc is OK.

If somebody else wants to, my patch for PR 85487 (which I'm going to re-propose
soon) adds a target-independent handle_pragma_ignore that could be used for
this, once the issue above is cleared up.

  parent reply	other threads:[~2022-11-04 20:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-24 15:58 [Bug c/61593] New: Support '#pragma mark - foo' " sean@rogue-research.com
2019-01-17  4:20 ` [Bug target/61593] Support '#pragma mark - foo' on non-Darwin targets " egallager at gcc dot gnu.org
2020-05-07 11:56 ` jakub at gcc dot gnu.org
2020-07-23  6:52 ` rguenth at gcc dot gnu.org
2021-04-08 12:02 ` rguenth at gcc dot gnu.org
2022-06-28 10:31 ` jakub at gcc dot gnu.org
2022-11-04 20:29 ` redi at gcc dot gnu.org [this message]
2023-07-07  7:27 ` rguenth at gcc dot gnu.org

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-61593-4-U10m7DNxJy@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).