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: [BUG] sizeof(bool) returns 4 ???????



Miklss Fazekas wrote:
| The optimal for us would be a swith for this in gcc (like the
| -fshort-wchart switch). This is what we asked in Radar: 325032.
| Such switch would make the transition from CW much easier for some
| folks, but on the other hand it could cause confusion in the future.

This is why assumptions like "bool will be one byte" that the standard doesn't guarantee shouldn't be made--to avoid exactly this sort of problem.

Aside from that, you now *know* it's problem, and you know that bool can change size moving between platforms. Hacking the compiler isn't optimal, except in a very short-term sense, because it *doesn't fix the bug*. It leaves it there, lying in wait for the next platform it bites you on. Why would you *not* want to *fix* the problem, instead of applying a band-aid? Why take the route that you *know* "could cause confusion in the future"?

Recall, too, that gcc is open source, and (I believe) Apple's version is available as part of the Darwin distribution. You don't have to wait for Apple to change it, nor depend on them *to* change it. You can add the switch yourself.

Glen Fisher
_______________________________________________
projectbuilder-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/projectbuilder-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: [BUG] sizeof(bool) returns 4 ??????? (From: Miklós Fazekas <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.