This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c/7475: gcc compiles illegal source code without generating any warnings


>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;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]