Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!seismo!brl-tgr!tgr!jeff@aids-unix From: jeff@aids-unix (Jeff Dean) Newsgroups: net.lang.c Subject: Re: pcc compiler error Message-ID: <8494@brl-tgr.ARPA> Date: Fri, 22-Feb-85 19:36:18 EST Article-I.D.: brl-tgr.8494 Posted: Fri Feb 22 19:36:18 1985 Date-Received: Wed, 27-Feb-85 02:42:46 EST Sender: news@brl-tgr.ARPA Lines: 34 > From: Kevin Szabo > > > struct xy { > > int x; > > int y; > > } a; > > main() > > { > > struct xy *p; > > p = &a; > > if (*p) { > > /* compiler error: zzzcode- bad type */ > > } > > } > >This is not legitimate code (and the compiler should point this out). > > Our BSD 4.2 compiler generates the same error when I just compile it. > As Marty Shannon says, the code is incorrect. The thing that mystifies > me is that LINT didn't even peep when I sent the code to it. Thus > whatever is wrong with CC is also confusing lint, but in a way that > causes LINT to incorrectly shut up. > It seems to me that the code is legal C (though not necessarily all that meaningful). Since C now allows structures to be passed as parameters, it appears inconsistent to allow something like "foo(*p)" but not "if(*p)". Since the code is legal, lint has no reason to complain. The error message you received indicated that the back end of your compiler was not able to generate code. There are C compilers that will compile this program. jd