stack quirk?
Jan Christiaan van Winkel
jc at atcmp.nl
Mon Jul 30 18:05:24 AEST 1990
>From article <359 at taumet.com>, by steve at taumet.com (Stephen Clamage):
> brianh at hpcvia.CV.HP.COM (brian_helterline) writes:
>
> |>printf("\n%d %d\n", ++i, ++i);
> |> etc
> Such code is often not warned-about by compilers, and may produce
> surprisingly different results on different systems.
Lint's usefulness is too often underestimated. Whenever a program does not
produce the results I expect, the first thing I'll do is use lint. I cannot
stress this enough! USE LINT
cat tst.c
main()
{
int i;
i=5;
(void)printf("\n%d %d\n",++i, ++i);
return 0;
}
lint tst.c
tst.c
==============
(6) warning: i evaluation order undefined
JC
--
Jan Christiaan van Winkel Tel: +31 80 566880 jc at atcmp.nl
AT Computing P.O. Box 1428 6501 BK Nijmegen The Netherlands
More information about the Comp.lang.c
mailing list