home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!daresbury!doc.ic.ac.uk!ibmassc!yktnews!admin!flu!marc
- From: marc@watson.ibm.com (Marc Auslander)
- Newsgroups: comp.arch
- Subject: Re: 32 => 64 Transition
- Message-ID: <MARC.92Aug19170300@marc.watson.ibm.com>
- Date: 19 Aug 92 22:03:00 GMT
- References: <340@moene.indiv.nluug.nl> <1992Aug08.165832.114442@cs.cmu.edu>
- <1992Aug11.125326.16719@email.tuwien.ac.at> <id.UHAS.9TA@ferranti.com>
- Sender: news@watson.ibm.com (NNTP News Poster)
- Organization: IBM T.J. Watson Research Center, Hawthorne, New York
- Lines: 20
- In-Reply-To: peter@ferranti.com's message of 12 Aug 92 14:46:45 GMT
- Disclaimer: This posting represents the poster's views, not necessarily those of IBM
- Nntp-Posting-Host: marc.watson.ibm.com
-
- The intent of ANSI C appears to be that int is the "natural"
- arithmetic of the machine. This is reflected in the integer promotion
- rules, which promote to int but NOT to long. Thus,
-
- int i,j;
- long k;
- k=i+j;
-
- is defined to do its arithmetic in int, producing an int result, and
- then convert to long at the assignment. If i+j overflows (as int) the
- results are undefined. The idea clearly is that compilers shouldn't
- be forced to use the possibly less efficient long arithmetic on ints.
- Only by making int 64, or by changing the role of int in defining the
- way expressions are evaluated, can we avoid this and other anomalies.
-
- --
-
-
- Marc Auslander (IBM)<marc@marc.watson.ibm.com> 914 784-6699
- (Internet)<marc@watson.ibm.com>
-