Re: How to detect endian-ness in Swift?
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