I just noticed the following warning while compiling NSCalendar.m:

NSCalendar.m: In function '-[NSCalendar initWithCalendarIdentifier:]':
NSCalendar.m:264:3: warning: overflow in implicit constant conversion 
[-Woverflow]
NSCalendar.m:265:3: warning: overflow in implicit constant conversion 
[-Woverflow]

Looking at the source, the code assigns NSNotFound to the members firstWeekday 
and minimumDaysInFirstWeek. Both members are declared as int32_t, which means 
that NSNotFound will get truncated to -1 on a 64-bit target. This means that 
the later checks whether the member contain NSNotFound will always fail on a 
64-bit target. What would be wrong with using -1 instead of NSNotFound in the 
first place?

Wolfgang


_______________________________________________
Gnustep-dev mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to