Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think.com!compass!worley From: worley@compass.com (Dale Worley) Newsgroups: comp.lang.c Subject: Re: Can analysis detect undefined expressions? Message-ID: Date: 18 Jun 91 13:55:21 GMT References: <14206.285B7688@stjhmc.fidonet.org> <6371@goanna.cs.rmit.oz.au> Sender: root@compass.com Organization: Compass, Inc., Wakefield, MA, U.S.A. Lines: 17 In-reply-to: ok@goanna.cs.rmit.oz.au's message of 17 Jun 91 12:36:36 GMT In article <14206.285B7688@stjhmc.fidonet.org>, Dave.Harris@f14.n15.z1.fidonet.org (Dave Harris) writes: > An extended example so that I can think clearly here: > (j = ((i=1) == (i=2))) == (j = ((i=3) == (i=4))) > Assumedly, i can end up as 1,2,3, or 4. j should be 0. The grouping is such > that i=4, i=2, i=3, i=1 won't happen without breaking any laws. right? Sorry to belabor this yet again, but there is no requirement in Ansi C that i have one of the values 1, 2, 3, or 4. The effect of this statement is "undefined", which means that the implementation can do *anything*, including giving i the value 100, core dumping, or starting World War III. Ditto for j. The mere fact that none of these actions are mentioned in the statement is irrelevant. Dale Worley Compass, Inc. worley@compass.com -- I'd sign on for the War on Drugs if they'd include alcohol and nicotine on the official hit list.