From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 085AB385841E; Fri, 4 Nov 2022 20:29:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 085AB385841E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667593766; bh=ypLAEATVfxwQgTPj2TlCzqvlGvHfcxwZNUlUcFjhdpo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XzXRzLlW7+fd7cO3lpAKJbq5LNT5PeMu9p5mDRRCh9jmcmOcUrNibPpOg9x+RCdZD +SwtL/WZy537KdpphNq97yK3EvvYll5AuKV5c+h6+vXRbWniDo9NYxKSpSM6tJ4514 yZHjReCCcc1SN5dNciyKl2r7qXoxIrvGPwrVizPE= From: "redi at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: easyhack X-Bugzilla-Severity: enhancement X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D61593 --- Comment #13 from Jonathan Wakely --- (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: >=20 > if (!flag_preprocess_only) \ > cpp_register_pragma (parse_in, NULL, "mark", \ > darwin_pragma_ignore, false); >=20 > ...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 mysel= f. 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-pro= pose soon) adds a target-independent handle_pragma_ignore that could be used for this, once the issue above is cleared up.=