public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/5897: No warning for statement after return
@ 2002-12-11 14:01 bangerth
0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2002-12-11 14:01 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, yooden
Synopsis: No warning for statement after return
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Wed Dec 11 14:01:53 2002
State-Changed-Why:
Confirmed with present 3.3CVS. You must add -Wunreachable-code,
but it doesn't detect the problem here either.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5897
^ permalink raw reply [flat|nested] 2+ messages in thread
* c/5897: No warning for statement after return
@ 2002-03-09 4:16 yooden
0 siblings, 0 replies; 2+ messages in thread
From: yooden @ 2002-03-09 4:16 UTC (permalink / raw)
To: gcc-gnats
>Number: 5897
>Category: c
>Synopsis: No warning for statement after return
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Mar 09 04:16:02 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: yooden@vranx.de
>Release: 2.95.3, provided by SuSE 7.2
>Organization:
>Environment:
Linux eumel 2.4.4-4GB #1 Wed May 16 00:37:55 GMT 2001 i686 unknown
>Description:
In an if-else combo, statements after the returns are not reported when running:
gcc -O3 -Wall -pedantic
- - -
static int broken()
{
int i;
if (0)
{
return(1);
i = 0;
} else
{
return(1);
i = 0;
}
}
>How-To-Repeat:
gcc -O3 -Wall -pedantic -c broken.c -o broken.o
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="broken.i"
Content-Disposition: inline; filename="broken.i"
# 1 "broken.c"
static int broken()
{
int i;
if (0)
{
return(1);
i = 0;
} else
{
return(1);
i = 0;
}
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-12-11 22:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-11 14:01 c/5897: No warning for statement after return bangerth
-- strict thread matches above, loose matches on Subject: below --
2002-03-09 4:16 yooden
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).