Expression sequencing query

Ken Harrenstien KLH at SRI-NIC.ARPA
Mon Sep 29 07:53:45 AEST 1986


Someone asked what other compilers produced for the expression:
	a = ((b=1),b) + ((b=2),b) + ((b=3),b);

I just tried it on KCC, the PDP-10 C compiler that I and others have
developed (not a commercial product, but available).  It returns 6.
Of course, if it didn't I would have fixed it!
	As a general observation on questions of this nature, I would
expect that compilers written since the publication of H&S have been
much better (cleaner, more consistent, more predictable, etc) than
their predecessors, because H&S is a much, MUCH better guide than K&R.
Unfortunately for future implementors, the ANSI draft is more like K&R
than H&S...
-------



More information about the Comp.lang.c mailing list