pcc compiler error

Henry Spencer henry at utzoo.UUCP
Thu Feb 28 04:38:43 AEST 1985


> 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.

Sorry, the code is not legal.  Passing a struct as a parameter is
basically struct assignment, which is in modern C.  Giving a struct
to an if is struct comparison (against 0), which is not and has never
been part of C.  (It's not in the current ANSI C draft either.)
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry



More information about the Comp.lang.c mailing list