Path: utzoo!utgpu!water!watmath!clyde!rutgers!ames!ucbcad!beeblebrox!rudell
From: rudell@beeblebrox.uucp (Richard Rudell)
Newsgroups: comp.lang.c
Subject: Re: X3J11 meeting notes
Summary: re-arranging parentheses (integer expressions)
Keywords: ANSI C standard
Message-ID: <2149@ucbcad.berkeley.edu>
Date: 18 Dec 87 03:44:17 GMT
References: <6829@brl-smoke.ARPA> <406@mn-at1.UUCP> <6852@brl-smoke.ARPA> <13899@think.UUCP>
Sender: news@ucbcad.berkeley.edu
Reply-To: rudell@beeblebrox.UUCP (Richard Rudell)
Organization: U.C. Berkeley EECS CAD Group
Lines: 23


Simple comment on re-arrangement of integer expressions ...

Doesn't ANSI leave the affect of integer overflow implementation defined ?
(Someone please correct me if this has also changed since the last
review draft.)

Doesn't this mean that for integer expressions such as:

	(a - 1) + 1

the compiler is still free to re-arrange the parentheses ?  The claim
has been made "but if integer traps are enabled, the compiler can't
change this".  But an ANSI conforming compiler is free to do whatever
it wants whenever it wants when integer overflow occurs.  Thus, an ANSI
compiler can re-arrange these parentheses and still meet the "as if"
condition which controls the entire interpretation of the ANSI
C specification.  

The point is, ANSI never promised what might happen if 'a' was the most 
positive integer.  Has this interpretation also changed ?

Rick.