bug in lint

Guy Harris guy at rlgvax.UUCP
Tue Feb 12 10:55:50 AEST 1985


> The following program causes our 4.2BSD lint to core-dump:
> 
> 	struct { a x; };
> 	typedef int *b, *a;
> 	struct { b y; a z; };
> 
> I don't have a fix.

I tried it with PCC (which also drops core) on our system.  There is
a bug in PCC, probably in the error recovery rules in the grammar,
that causes the compiler to think it's processing an initialization
when it isn't.  Since it hasn't run all the proper code to handle the
initialization, some global pointer isn't properly initialized, but is
dereferenced by the code that thinks it's processing an initialization,
and it dies.  There may be a fix, but it's probably a lot of work to find
it (including tweaking the error handling rules in the grammar).  Lots of
syntax errors cause this problem.

You might try putting the typedef before the "struct { a x; };" declaration
so that it knows about the typedef before trying to use it.

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy



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