Path: utzoo!attcan!uunet!husc6!mailrus!ames!nrl-cmf!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.std.c Subject: Re: nonportable code or incorrect compilers? Keywords: portable language standard Message-ID: <8156@brl-smoke.ARPA> Date: 25 Jun 88 05:34:00 GMT References: <133@daitc.ARPA> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB)) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 14 In article <133@daitc.ARPA> jkrueger@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.