• 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: How to detect endian-ness in Swift?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to detect endian-ness in Swift?


  • Subject: Re: How to detect endian-ness in Swift?
  • From: Marco S Hyman <email@hidden>
  • Date: Wed, 23 Jul 2014 20:37:37 -0700

>> Invert your test (test for big endian) to get rid of the warning.
>
> Excellent idea. Works perfectly.
> Is this behaviour a known compiler bug or a documented feature?

Guess... it is a compiler optimization.  It's what I'd expect to see
if the compiler can detect that Int(littleEndian: 42) == 42 is a
constant true on a little endian machine.  I'd even worry that the
compiler might optimize the else branch away.

Marc
 _______________________________________________
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: 
 >How to detect endian-ness in Swift? (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: How to detect endian-ness in Swift? (From: Chris Lattner <email@hidden>)
 >Re: How to detect endian-ness in Swift? (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: How to detect endian-ness in Swift? (From: Marco S Hyman <email@hidden>)
 >Re: How to detect endian-ness in Swift? (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: How to detect endian-ness in Swift?
  • Next by Date: Why this error in Xcode beta 4?
  • Previous by thread: Re: How to detect endian-ness in Swift?
  • Next by thread: How to select libraries in Xcode 6
  • Index(es):
    • Date
    • Thread