Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!ames!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: checking for overflow in C Message-ID: <10280@smoke.BRL.MIL> Date: 17 May 89 21:55:13 GMT References: <13367@dartvax.Dartmouth.EDU> <1989May6.224226.22085@utzoo.uucp> <1989May9.183140.1770@utzoo.uucp> <8172@june.cs.washington.edu> <1079@atanasoff.cs.iastate.edu> <1989May12.154417.21344@utzoo.uucp> <10256@smoke.BRL.MIL> <472@chem.ucsd.EDU> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 11 In article <472@chem.ucsd.EDU> tps@chem.ucsd.edu (Tom Stockfisch) writes: >Aren't unsigned int operations guaranteed not to generate exceptions? C guarantees that unsigned integer arithmetic is performed as modular arithmetic. >It seems like the C compiler could/should have done things differently. Bascially, to avoid relying on benign integer overflow behavior would have required slower code to be generated. Several C implementations have made this same decision.