Does your compiler get this program right?

Doug Gwyn gwyn at smoke.BRL.MIL
Thu Dec 1 04:59:22 AEST 1988


In article <350 at lakart.UUCP> dg at lakart.UUCP (David Goodenough) writes:
-In particular, if I say
-	extern char *zoot();
-	*(zoot()) += '\001';
-and zoot() gets called twice in evaluating the above statement, then I'm
-going to ditch my C compiler because it's broken. If the standard says that
-zoot() can be called twice, then I'm going to ignore the standard, because
-IT'S broken.

The Standard has this right.  The problem reported, *f++ += *g++; causing
f to be incremented twice, is clearly wrong.  In fact it's a bug in many
versions of PCC.



More information about the Comp.lang.c mailing list