nonportable code or incorrect compilers?

Doug Gwyn gwyn at brl-smoke.ARPA
Sat Jun 25 15:34:00 AEST 1988


In article <133 at daitc.ARPA> jkrueger at daitc.ARPA (Jonathan Krueger) writes:
>My prediction, based on K&R, was the output:
>	count is 800, now 839
>Indeed, the Pyramid 98x produces exactly this output.
>But your mileage may vary.  4.2BSD VAX, Gould, and Sun-3 produce output:
>	count is 800, now 800

There is no ambiguity; the Pyramid has produced the correct answer
and the other three compilers are wrong.  The SVR2 VAX PCC also gets
this right, so presumably all recent 3B CCSes do also.

The code is "portable" to correct compilers.  Obviously it is not
"portable" to ALL compilers, as you have shown.  Nag your system
vendors to fix their compilers.



More information about the Comp.std.c mailing list