[3370] in Athena Bugs

home help back first fref pref prev next nref lref last post

(RT/PC) Version 6.3B: High C (error recovery)

daemon@ATHENA.MIT.EDU (Bill Sommerfeld)
Thu Oct 5 22:57:29 1989

Date: Thu, 5 Oct 89 22:57:01 -0400
From: Bill Sommerfeld <wesommer@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU
System type, version:	(RT/PC) Version 6.3B
System name:		portnoy
What's wrong:

The following program is missing a semicolon on the first line of
text:

extern int funca(int a, int b, int c)
extern int funcb(int a, int b, int c);
typedef int foo;
extern foo bar;

When compiled with high C (1.4 or 2.x), the error is not detected
until line four.

% cc -O -c foo.c
E "foo.c",L4/C12:       (syntactic)  unexpected symbol:'<IDENTIFIER>':bar
REPAIR:   ',' was inserted before '<IDENTIFIER>':bar@"foo.c",L4/C12

E "foo.c",L4/C1:        (syntactic)  unexpected symbol:'<END_OF_FILE>'
>>> END OF FILE reached without recovering -- aborting.

What should have happened:

It should have reported the error sooner; GCC reports:

% gcc -O -c foo.c
foo.c: In function funca:
foo.c:2: storage class specified for parameter `funcb'
foo.c:3: storage class specified for parameter `foo'
foo.c:4: storage class specified for parameter `foo'
foo.c:4: redeclaration of `foo'
foo.c:3: here is the previous declaration of `foo'
foo.c:4: parse error before `bar'
foo.c:2: parm types given both in parmlist and separately

						- Bill

home help back first fref pref prev next nref lref last post