• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Xcode seems to be generating bad code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Xcode seems to be generating bad code (From: Jeff Laing <email@hidden>)

  • Prev by Date: Xcode seems to be generating bad code
  • Next by Date: Xcode Cannot Evaluate "Implicit Dependencies"
  • Previous by thread: Xcode seems to be generating bad code
  • Next by thread: Re: Xcode seems to be generating bad code
  • Index(es):
    • Date
    • Thread