public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/7475: gcc compiles illegal source code without generating any warnings
@ 2002-08-02 12:06 geneing
0 siblings, 0 replies; 2+ messages in thread
From: geneing @ 2002-08-02 12:06 UTC (permalink / raw)
To: gcc-gnats
>Number: 7475
>Category: c
>Synopsis: gcc compiles illegal source code without generating any warnings
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Aug 02 12:06:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: geneing@myrealbox.com
>Release: 2.95.3 and 3.1
>Organization:
>Environment:
any
>Description:
compiler does not warn about illegal code and missing return statements. Attached program is missing a return statement in function foo (for some clauses) and ambiguous declaration of an array in function bar. Neither generates any warnings.
>How-To-Repeat:
gcc bug.c
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="bug.c"
Content-Disposition: inline; filename="bug.c"
int bar( void )
{
int i,j;
int a[i][j];
a[1][2]=5;
}
int foo( int j )
{
if( j == 5 )
return 7;
}
int main( void )
{
bar();
foo( 5 );
foo( 6 );
return 0;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: c/7475: gcc compiles illegal source code without generating any warnings
@ 2002-08-02 13:58 paolo
0 siblings, 0 replies; 2+ messages in thread
From: paolo @ 2002-08-02 13:58 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, geneing, nobody, paolo
Synopsis: gcc compiles illegal source code without generating any warnings
Responsible-Changed-From-To: unassigned->paolo
Responsible-Changed-By: paolo
Responsible-Changed-When: Fri Aug 2 13:58:03 2002
Responsible-Changed-Why:
Triaged.
State-Changed-From-To: open->closed
State-Changed-By: paolo
State-Changed-When: Fri Aug 2 13:58:03 2002
State-Changed-Why:
Please peruse the man/info sections on the various Warning
options.
paolo:~> gcc -Wall -pedantic 7475.c
7475.c: In function `bar':
7475.c:4: warning: ISO C89 forbids variable-size array `a'
7475.c:4: warning: ISO C89 forbids variable-size array `a'
7475.c:7: warning: control reaches end of non-void function
7475.c: In function `foo':
7475.c:13: warning: control reaches end of non-void function
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7475
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-08-02 20:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-02 12:06 c/7475: gcc compiles illegal source code without generating any warnings geneing
2002-08-02 13:58 paolo
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).