From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BDDF73954425; Thu, 17 Nov 2022 02:06:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BDDF73954425 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668650809; bh=vTm7Y7FZ9cILuNwBgz7vmBUJeMRyJgxBKonvhKzugHk=; h=From:To:Subject:Date:From; b=mUwniVh57MA7KljtpJfH1zB2RzfKjtDaM+zqB/pHfCwEeNElsoGfiVv2GfQqo7XXL eoFl6SyEN8dSiVARZvNd14QTcgEindACB6KB3D9Gm1jFa3AaXTewMgh5cSa2zDvm9g ylx+mKF6ot771cLhYqfF5/zfJxLUR1QBK1b0boEk= From: "sam at gentoo dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/107730] New: Trivial -Wreturn-type false positive when function marked static Date: Thu, 17 Nov 2022 02:06:49 +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: 12.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sam at gentoo dot org 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 attachments.created 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=3D107730 Bug ID: 107730 Summary: Trivial -Wreturn-type false positive when function marked static Product: gcc Version: 12.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: sam at gentoo dot org Target Milestone: --- Created attachment 53915 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D53915&action=3Dedit foo.i ``` #include static void *poll_logfiles(int n) { for (;;) { sleep(1); } } int main() { poll_logfiles(0); } ``` ``` $ gcc-9.5.0 /tmp/foo.c -Wreturn-type /tmp/foo.c: In function 'poll_logfiles': /tmp/foo.c:7:1: warning: no return statement in function returning non-void [-Wreturn-type] 7 | } | ^ # 10.4.1_p20221110 $ gcc-10 /tmp/foo.c -Wreturn-type /tmp/foo.c: In function 'poll_logfiles': /tmp/foo.c:7:1: warning: no return statement in function returning non-void [-Wreturn-type] 7 | } | ^ # 11.3.1_p20221111 $ gcc-11 /tmp/foo.c -Wreturn-type /tmp/foo.c: In function 'poll_logfiles': /tmp/foo.c:7:1: warning: no return statement in function returning non-void [-Wreturn-type] 7 | } | ^ # 12.2.1_p20221112 $ gcc-12 /tmp/foo.c -Wreturn-type /tmp/foo.c: In function =E2=80=98poll_logfiles=E2=80=99: /tmp/foo.c:7:1: warning: no return statement in function returning non-void [-Wreturn-type] 7 | } | ^ # 13.0.0_pre20221113 $ gcc-13 /tmp/foo.c -Wreturn-type /tmp/foo.c: In function 'poll_logfiles': /tmp/foo.c:7:1: warning: no return statement in function returning non-void [-Wreturn-type] 7 | } | ^ ```=