Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!ogicse!intelhf!ichips!iwarp.intel.com!inews!nevin!bhoughto From: bhoughto@nevin.intel.com (Blair P. Houghton) Newsgroups: comp.lang.c Subject: Re: When do you use "if ( a = b )"? (was Re: Funny mistake) Message-ID: <3648@inews.intel.com> Date: 4 Apr 91 04:58:49 GMT References: <20137@alice.att.com> <18099@crdgw1.crd.ge.com> <6773:Apr116:28:2991@kramden.acf.nyu.edu> Sender: news@inews.intel.com Organization: Intel Corp, Chandler, AZ Lines: 16 In article <6773:Apr116:28:2991@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: >I believe the original post contained a phrase like ``upon overflow.'' >Nothing's guaranteed for ints upon overflow. I'm not sure if your CPU is >allowed to explode, but you're allowed to get weird results. No bet when "the behavior is undefined." And to answer Chris' question, if the type of the two things is unsigned, there can be no overflow (underflow) (I'm 2.83 miles from my copy or I'd quote you chapter and verse, of course), so they couldn't be unsigned and behave in an undefined manner. --Blair "It's best to be precise, though that doesn't imply accurate..."