bug in lint

Guy Harris guy at rlgvax.UUCP
Sun Feb 17 11:50:14 AEST 1985


> I've seen LINT or PCC dump core on a number of occasions, although in
> all cases the program being processed was incorrect and error messages
> were printed before the dump occured.  Fixing the error that caused
> the error message(s) also eliminated the core dump.
> On the other hand, the ``bad initialization'' error message is a good
> example of the often cryptic (and in this case incorrect) error messages
> that PCC emits.
> In this particular case, I suspect that the problem lies in how the
> grammar handles ``old-fashioned initializations'';

I suspect you're right.  The problem is that PCC gets confused, probably
due to error recovery, and thinks it's processing an initialization.
Unfortunately, it assumes that some routine that is called earlier in
the processing of an initialization has been called, and has set a
global pointer to point somewhere meaningful; alas, it has not, and it
dies trying to dereference that pointer.

> if instead of making allowances for this by just issuing a warning the
> compiler *required* an equal-sign before the initializer, the problem
> would likely go away.  In fact, I'd vote for such a change...

As of System V, all the old syntax (initializers without "=", the "=+",
"=-", "=*", etc. operators) has, indeed, disappeared.  Anybody out there
with a S5 compiler care to try some of the guys that cause earlier PCCs to
drop core?

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



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