From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E96863858C50; Fri, 20 Jan 2023 15:10:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E96863858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674227447; bh=TGEeYlyk23rWi3V1QkpN4MLstWcYTDiAJN8EP69Vu4U=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lL0EyAqcLbDs1R+zihBzdQAyxHAzGnklvlwGwZLwSlsfCV2Q/EAj9FQGxKXENNZCy ZqXF1ZTdDbrNj5C6Tf4Jc6SoMt55atorFmUFHib4wZ2fYN95BtPJgDGTT26IKXgCHm 6crvGF0r6P6yNOyJZNK9qyQTAAebdpAHMHfwJjOw= From: "vincent-gcc at vinc17 dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/53232] No warning for main() without a return statement with -std=c99 Date: Fri, 20 Jan 2023 15:10:47 +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: 4.7.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: vincent-gcc at vinc17 dot net 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=3D53232 --- Comment #18 from Vincent Lef=C3=A8vre -= -- (In reply to Jakub Jelinek from comment #17) > Yeah, but warnings with high false positivity rates at least shouldn't be= in > -Wall. Well, there already is -Wunused, which is included in -Wall (such warnings = may typically be emitted due to #if and also in temporary code when debugging),= and -Wsign-compare in C++. Anyway, there is a first issue: the warning is inexistent, even with -Wextr= a. There is a second issue: the warning is not emitted with -Wreturn-type when there is a call to main(). Solving these two issues alone would not yield a high false positivity rate with -Wall. (That said, I think that developers should be encouraged to have an explicit "return" for main(); in particular, this is really easy to do and improves the code readability, specially know= ing the difference of behavior with other languages, such as shell scripts and Perl.)=