From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 735E03858D1E; Wed, 21 Dec 2022 11:03:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 735E03858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1671620596; bh=t1b++VRPKwEUCKguoKSWpRvMH56iFskt3DE6B8N3Xic=; h=From:To:Subject:Date:From; b=Y6PIiDj02Ad1wB1Wf9NqtAJQom6+RQ+YD4IigBDsAc6r9dug+tjPN8ipGDpSPtU5e rJ9t9UqmHj7gInK2bWl6kxfCdHnGsdsx+jqODe26M+iAfWWun2qCWtWeTJSUKlOm/C dAeye1WaOPusXcR4DXrxCFiFvDmu4UqTqFifAJOw= From: "pskocik at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/108194] New: GCC won't treat two compatible function types as compatible if any of them (or both of them) is declared _Noreturn Date: Wed, 21 Dec 2022 11:03:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pskocik at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D108194 Bug ID: 108194 Summary: GCC won't treat two compatible function types as compatible if any of them (or both of them) is declared _Noreturn Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: pskocik at gmail dot com Target Milestone: --- (same with __attribute((noreturn))) Example (https://godbolt.org/z/ePGd95sW= z): void FN_A(void); void FN_B(void); _Noreturn void NR_FN_A(void); _Noreturn void NR_FN_B(void); _Static_assert(_Generic((__typeof(*(FN_A))*){0}, __typeof(*(FN_B))*: 1), ""= ); //OK =E2=9C=93 _Static_assert(_Generic((__typeof(*(NR_FN_A))*){0}, __typeof(*(NR_FN_B))*: = 1), ""); //ERROR =E2=9C=97 _Static_assert(_Generic((__typeof(*(FN_A))*){0}, __typeof(*(NR_FN_B))*: 1), ""); //ERROR =E2=9C=97 As you can see from the Compiler Explorer link, clang accepts all three, wh= ich is as it should be as per the standard, where _Noreturn is a function speci= fier (https://port70.net/~nsz/c/c11/n1570.html#6.7.4), which means it shouldn't = even go into the type. (Personally, I don't even mind it going into the type just as long as two otherwise identical _Noreturn functio declarations are deemed as having the same type). Regards, Petr Skocik=