Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!iuvax!rutgers!uwm.edu!cs.utexas.edu!samsung!uunet!mcsun!hp4nl!sci.kun.nl!atcmpe!jc From: jc@atcmp.nl (Jan Christiaan van Winkel) Newsgroups: comp.lang.c Subject: Re: stack quirk? Message-ID: <642@atcmpe.atcmp.nl> Date: 30 Jul 90 08:05:24 GMT References: <359@taumet.com> Organization: AT Computing, Nijmegen, The Netherlands Lines: 31 From article <359@taumet.com>, by steve@taumet.com (Stephen Clamage): > brianh@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@atcmp.nl AT Computing P.O. Box 1428 6501 BK Nijmegen The Netherlands