From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5D1EA384AB67; Mon, 22 Apr 2024 19:42:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D1EA384AB67 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713814976; bh=WYYAA3SlUU7FWnQDwXodt8vhCGcWs7siD30sbNZx6sc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=yww7tOJhrJJa494Cyck/ngCgxM7cAQbQm5LlV+QMJD/sPnB4DU2pujQDbGJRjKYOM 8MOkZfYlpec5SarUlKUSStLt8EWdUP4B6UNxIoFIDeyeaWismNys5YHqbMU2Z/HC6E TQkqGka6ZEz/UhtkGHj26RE2EBqm3U1/V7zdcNQg= From: "luigighiron at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/114808] Qualified void return type is not diagnosed Date: Mon, 22 Apr 2024 19:42:55 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: accepts-invalid, diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: luigighiron at gmail dot com 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: --- 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=3D114808 --- Comment #5 from Halalaluyafail3 --- I made this bug report because of the warning that clang has, but the follo= wing paragraph may allow this: > If, in the declaration "T D1", D1 has the form > D ( parameter-type-list ) > or > D ( identifier-list opt ) > and the type specified for ident in the declaration "T D" is > "derived-declarator-type-list T", then the type specified for > ident is "derived-declarator-type-list function returning the > unqualified version of T". Section 6.7.6.3 "Function declarators (including prototypes)" Paragraph 4 ISO/IEC 9899:2018 GCC seems to be using this to not make a diagnostic here, e.g. it warns wit= h a return type of _Atomic void in C17 mode but not in C23 mode where the text = here was updated to indicate that the result is the unqualified and non-atomic version of T. If this would make the text talking about the return type of = the function refer to the unqualified return type then this should be allowed I think, and I will make a bug report to clang to get this diagnostic changed= .=