C compiler incorrectly handles castes on lhs

Henry Spencer henry at utzoo.UUCP
Fri Sep 20 02:35:04 AEST 1985


>	The Vax 4.2 C compiler incorrectly generates a fatal error message
>	when castes to a pointer type appear on the lhs of an assignment.
>	The SUN C compiler and other c compilers I have tried correctly
>	handle this assignment.

I believe that modern definitions of C make it clear that this is not
legal C; the SUN C compiler (and others) are being sloppy.  The cast has
to go on the right-hand-side, casting the value to the type of the
variable rather than vice-versa.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry



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