-dateWithTimeIntervalSinceNow: 64-bits may overflow
-dateWithTimeIntervalSinceNow: 64-bits may overflow
- Subject: -dateWithTimeIntervalSinceNow: 64-bits may overflow
- From: Jerry Krinock <email@hidden>
- Date: Sat, 08 Oct 2011 21:09:15 -0700
Don't do this:
-[NSDate dateWithTimeIntervalSinceNow:FLT_MAX] ;
Expected result: A date far off into the future which will always behave as though it is later than or equal to any other date.
No problem ever in 32-bit executable.
In 64-bit, -[NSDate compare:] and -[NSDate laterDate:] still work as expected. But other methods may not. For example, -[NSConditionLock lockWhenCondition:beforeDate:] seems to think that such a "float max date" has already past and returns NO immediately, regardless of its 'condition'.
I filed a bug, 10256461, but am posting here because I suppose Apple may consider this to be a programming error and not a bug.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden