Re: Xcode seems to be generating bad code
Re: Xcode seems to be generating bad code
- Subject: Re: Xcode seems to be generating bad code
- From: Andreas Grosam <email@hidden>
- Date: Thu, 26 Apr 2012 13:02:39 +0200
On Apr 26, 2012, at 11:43 AM, Jeff Laing wrote:
> The "cmn.w" apparently compares the negative value - how it managed to store the negative of INT_MIN (which is defined as -(INT_MAX + 1) I don't know.
Hm.
IFF the type of INT_MAX equals a signed integer (int, short, long, long long, signed char) , the expression "(INT_MAX + 1)" is undefined behavior (C99, overflow of signed integers).
Is this actually written literally in a standard library header (limits.h)?
It should be better defined as
#define INT_MIN (-INT_MAX - 1)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden