Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GCC 4 and strict aliasing



Hi Eric,

I will file a bug report, but in the mean time, is there any way to turn off strict aliasing? If not, that is a bug in GCC then and there must be a *large* number of people running into it, I guess.

Best regards,
Frederik Slijkerman

----- Original Message ----- From: "Eric Albert" <email@hidden>
To: "Frederik Slijkerman (FabFilter)" <email@hidden>
Cc: <email@hidden>
Sent: Friday, 17 March 2006 18:09
Subject: Re: GCC 4 and strict aliasing



On Mar 17, 2006, at 1:19 AM, Frederik Slijkerman (FabFilter) wrote:

I'm compiling an Audio Unit that uses the CoreAudio SDK which I don't want to change, and there is a strict aliasing issue in AUElement::RestoreState() that means that the audio unit cannot properly restore its state. Here are the offending lines:

 UInt32 temp = EndianU32_BtoN(*(UInt32 *)p);
 entry.value = *(Float32 *)&temp;
 p += sizeof(Float32);

The *(Float32 *)&temp expression is compiled incorrectly on the PowerPC architecture which gives entry.value a random value. Interestingly enough, on Intel the correct code is produced.

Please file a bug report. As you've noticed, that's not the best way to swap a float.


Thanks,
Eric


_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden
References: 
 >GCC 4 and strict aliasing (From: "Frederik Slijkerman (FabFilter)" <email@hidden>)
 >Re: GCC 4 and strict aliasing (From: Eric Albert <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.