Order of evaluation and optimizing code

Henry Spencer henry at utzoo.UUCP
Sun Nov 9 20:17:12 AEST 1986


> ...It does preserve compatibility in the
> sense that code that uses it will compiler on a compiler that doesn't know
> about it...but will the compiled code work?  If the compiler does not
> realize the significance of the unary plus and doesn't maintain the specified
> order of evaluation, is the compiled code going to work?  Probably not.

Not a problem, because it *won't* compile on a compiler that doesn't know
about it.  Pre-X3J11 C does not have a unary plus operator!

> ...remember that Berkeley and other institutions have
> already taken it upon themselves to add things that aren't in the
> original K&R spec, such as structure assignment.  Are you going to tell
> me that a compiler which allows structure assignment "isn't a C compiler"?

Sorry, you are mistaken about the history.  Structure assignment came from
Dennis Ritchie & Co. at Bell Labs, the originators of C.  If you doubt me,
find a V7 Unix manual and look at the one-page addendum to the C Reference
Manual.  K&R slightly predates V7, and hence doesn't mention it.  (For that
matter, V7 was not the last word on C evolution within Bell, as you will
see if you compare the V7 C manual with the SysV C manual:  no, "void"
and "unsigned char" and such were *not* invented by Berkeley.)

There have actually been remarkably few non-standard additions to C by
compiler writers -- a considerable tribute to Dennis's skill at devising
a language that lets you do what you want.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,decvax,pyramid}!utzoo!henry



More information about the Comp.lang.c mailing list