c/7475: gcc compiles illegal source code without generating any warnings
geneing@myrealbox.com
geneing@myrealbox.com
Fri Aug 2 12:06:00 GMT 2002
>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;
}
More information about the Gcc-bugs
mailing list