C compiler incorrectly handles castes on lhs
Kurt Guntheroth
kurt at fluke.UUCP
Thu Sep 19 04:28:15 AEST 1985
Index: </usr/src/lib/pcc>/<source file> 4.2BSD
Description:
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.
The example below is artificial. I know there is a way to recode it
to avoid this bug, but that is not the point.
Repeat-By:
Compiling the following file % cc -c test.c
------------ test.c ---------------
main()
{
struct foo { int a,b; } ;
char * malloc();
char * cp;
((struct foo *) cp) = (struct foo *) malloc (sizeof (struct foo));
}
--------- end of test.c ------------
"test.c", line 8: illegal lhs of assignment operator
--
Kurt Guntheroth
John Fluke Mfg. Co., Inc.
{uw-beaver,decvax!microsof,ucbvax!lbl-csam,allegra,ssc-vax}!fluke!kurt
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list