Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2.fluke 9/24/84; site vax2.fluke.UUCP
Path: utzoo!watmath!clyde!cbosgd!ihnp4!houxm!vax135!cornell!uw-beaver!fluke!kurt
From: kurt@fluke.UUCP (Kurt Guntheroth)
Newsgroups: net.bugs.4bsd
Subject: C compiler incorrectly handles castes on lhs
Message-ID: <937@vax2.fluke.UUCP>
Date: Wed, 18-Sep-85 14:28:15 EDT
Article-I.D.: vax2.937
Posted: Wed Sep 18 14:28:15 1985
Date-Received: Thu, 19-Sep-85 06:50:53 EDT
Organization: John Fluke Mfg. Co., Inc., Everett, WA
Lines: 29

Index:	/ 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