Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site rlgvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!seismo!rlgvax!guy From: guy@rlgvax.UUCP (Guy Harris) Newsgroups: net.bugs.4bsd Subject: Re: bug in lint Message-ID: <466@rlgvax.UUCP> Date: Mon, 11-Feb-85 19:55:50 EST Article-I.D.: rlgvax.466 Posted: Mon Feb 11 19:55:50 1985 Date-Received: Wed, 13-Feb-85 01:43:54 EST References: <376@harvard.ARPA> Distribution: net Organization: CCI Office Systems Group, Reston, VA Lines: 23 > 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