From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 674AD3857C74; Thu, 28 Oct 2021 01:53:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 674AD3857C74 From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/102953] Improvements to CET-IBT and ENDBR generation Date: Thu, 28 Oct 2021 01:53:27 +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: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: hjl.tools at gmail dot com X-Bugzilla-Target-Milestone: --- 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Oct 2021 01:53:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102953 --- Comment #10 from H.J. Lu --- (In reply to Andrew Cooper from comment #8) > Actually, there is a (possibly pre-existing) diagnostics issue: >=20 > $ cat proto.c > static void __attribute__((cf_check)) foo(void); > static void __attribute__((unused)) foo(void) > { > } > void (*ptr)(void) =3D foo; >=20 > $ gcc -Wall -Os -fcf-protection=3Dbranch -mmanual-endbr > -fcf-check-attribute=3Dno -c proto.c -o proto.o > proto.c:2:37: error: conflicting types for 'foo'; have 'void(void)' > 2 | static void __attribute__((unused)) foo(void) > | ^~~ > proto.c:1:39: note: previous declaration of 'foo' with type 'void(void)' > 1 | static void __attribute__((cf_check)) foo(void); > | ^~~ >=20 >=20 > The diagnostic complaining that the forward declaration doesn't match the > definition gives 'void(void)' as the type in both cases, leaving out the > fact that they differ by cf_check-ness. Please try the v2 patch.=