bug in C compiler

Eduardo Krell[arm] ekrell at ulysses.homer.nj.att.com
Tue Apr 19 00:39:38 AEST 1988


The following bug is present in both the 4.3 BSD and the System V compilers
(and I would guess all other pcc-based compilers as well).

If you forget the "goto" keyword in a goto statement, the compiler doesn't
complain. Try the following:

main(){
foo:
	foo;		/* this was intended to be a "goto foo;" statement */
}

I know labels and variables share the same name space, but this is not
legal C code.

I discovered this bug when I recompiled a program with the GNU C Compiler,
which issued an undeclared variable error.
-- 
    
    Eduardo Krell                   AT&T Bell Laboratories, Murray Hill

    {ihnp4,ucbvax}!ulysses!ekrell	ekrell at ulysses.att.com



More information about the Comp.bugs.4bsd.ucb-fixes mailing list