Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!ucbvax!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!mcvax!unido!tub!net From: net@tub.UUCP (Oliver Laumann) Newsgroups: comp.lang.c Subject: Lvalues and casts Message-ID: <847@tub.UUCP> Date: 23 May 89 08:20:56 GMT Reply-To: net@tub.UUCP (Oliver Laumann) Organization: Technical University of Berlin, Germany Lines: 18 I just found out (by accident; I didn't want to actually use it) that the GNU cc with the -ansi option, the cc under SunOS 4.0 and the Greenhills C-compiler all happily compile the following program (without any warnings): f () { int *ip; char *cp; (int *)cp = ip; } The PCC, however, says "illegal lvalue in assignment". Is this legal C, i.e. is the result of a cast really an lvalue? Regards, -- Oliver Laumann net@TUB.BITNET net@tub.UUCP