Path: utzoo!utgpu!attcan!uunet!lll-winken!ames!xanth!nic.MR.NET!shamash!tank!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.lang.c Subject: Re: Broken compilers? (was Re: Comma Operator) Message-ID: <15474@mimsy.UUCP> Date: 15 Jan 89 15:41:48 GMT References: <922@quintus.UUCP> <1904@buengc.BU.EDU> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 22 -> printf("%d %d %d\n", (x = 1, y = 2), x, y); In article <1904@buengc.BU.EDU> bph@buengc.BU.EDU (Blair P. Houghton) writes: -A while back, someone indicated that they knew of a compiler optimizer -that would reduce something such as the above (ostensibly through -constant-reduction) to - -printf("%d %d %d\n", (1,2), x, y); - -or maybe even - -printf("%d %d %d\n", 2, x, y); - -So, you compiler-writing C-programmers, is this thing broken or what? Quite thoroughly, unless both x and y are `dead'. The side effect(s), if any, of any expression that occurs anywhere may not be arbitrarily deleted. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris