[gnu.gcc.bug] Missing semicolon causes rest of file to be ignored. Gcc 1.30

pardo@june.cs.washington.edu (David Keppel) (02/19/89)

SUMMARY: Missing ';' causes rest of file to be ignored.
GCC: 1.30
TARGET: VAX/ULTRIX
Built using standard shell script.


The following program has an (erroneous) declaration of `struct bug'.
There is no semicolon after the token `foo'.  The file after the
following extern declaration is ignored.

I believe that this is an illegal construct, so gcc should print a
diagnostic rather than compiling the file.  If the construct is legal,
then it should not be ignoring the rest of the file.

I haven't tried this with 1.33, so it might be fixed already.



gcc -g -W -Wimplicit -Wreturn-type -Wcomment -Wunused -v -c bug.c
gcc version 1.30
 /uns/src/GNU/g++/lib/gcc-cpp -v -undef -D__GNU__ -D__GNUC__ -Dvax -Dunix -Wcomment bug.c /tmp/cc016443.cpp
GNU CPP version 1.30
 /uns/src/GNU/g++/lib/gcc-cc1 /tmp/cc016443.cpp -quiet -dumpbase bug.c -g -W -Wimplicit -Wreturn-type -Wcomment -Wunused -version -o /tmp/cc016443.s
GNU C version 1.30 (vax) compiled by GNU C version 1.30.
 as /tmp/cc016443.s -o bug.o
Loading a.out ... Undefined:
_main
*** Error code 1

Stop.


bug.c:

    typedef struct bug {
	int y;
    } foo

    extern int exit();

	int
    buggy(x, y)
    buggy(y, x)
	int x, y;
    {
	if (x) return y;
	return x;
    }

	int
    main()
    {
	1 2 3 4, who\'s that knocking on my door?
	buggy(1);
	exit(0);
    }

end of bug.c

	;-D on  ( A small matter of atoms )  Pardo
-- 
		    pardo@cs.washington.edu
    {rutgers,cornell,ucsd,ubc-cs,tektronix}!uw-beaver!june!pardo