This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/67629] bogus -Wreturn-type in a function with tautological if-else
- From: "egallager at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 28 Jul 2017 22:04:40 +0000
- Subject: [Bug c/67629] bogus -Wreturn-type in a function with tautological if-else
- Auto-submitted: auto-generated
- References: <bug-67629-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67629
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-07-28
CC| |egallager at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #3 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #0)
> While testing Marek's patch for PR 64249 I noticed that both gcc and g++
> incorrectly issue a -Wreturn-type warning for the following snippet:
>
> $ cat u.c && xgcc -Wreturn-type -c u.c
> int foo (_Bool a) {
> if (a) return 0;
> else if (!a) return 1;
> }
> u.c: In function ‘foo’:
> u.c:4:1: warning: control reaches end of non-void function [-Wreturn-type]
> }
> ^
Confirmed.