@encode(long double) is the same as @encode(double) on i386

Number:rdar://6468314 Date Originated:28-Dec-2008 03:52 PM
Status:Duplicate/4900615 Resolved:2010-08-16
Product:Mac OS X Product Version:10.5.6 / 9G55
Classification:Serious Bug Reproducible:Always
28-Dec-2008 03:52 PM Vincent Gable:
@encode(long double) and @encode(double) both result in "d", when building for 32-bit x86.  But a long double is not the same as a double.  sizeof(long double) = 16; sizeof(double) = 8.

Steps to Reproduce:
NSLog(@"sizeof(double) = %d @encode(double) = %s", sizeof(double), @encode(double));
NSLog(@"sizeof(long double) = %d, @encode(long double) = %s", sizeof(long double), @encode(long double));

Expected Results:
if sizeof(long double) != sizeof(double), I expected @encode(double) to be distinct from @encode(long double).

Actual Results:
@encode(long double) and @encode(double) both were "d".



Fixed at latest Mac OS X 10.6.4

On 2010-08-16 I ran a test and @encode(long double) = 'D' on Mac OS X 10.6.4. I'm not sure when the bug was fixed. I'm not sure where it's fixed, since I haven't tested any iOS devices yet.

By vincent.gable at Aug. 16, 2010, 10:14 a.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!