Re: CodeWarrior to XCode
Re: CodeWarrior to XCode
- Subject: Re: CodeWarrior to XCode
- From: Eric Albert <email@hidden>
- Date: Sun, 5 Sep 2004 03:45:15 -0700
On Sep 4, 2004, at 8:32 PM, tyler wrote:
On Aug 26, 2004, at 11:54 PM, Eric Albert wrote:
You may want to investigate GCC's -fshort-wchar switch. When it's
turned on, wchar_t is 2 bytes rather than 4. The catch is that, as
with any switch that changes the size of a standard type, it isn't
ABI-compatible. If you enable this, you shouldn't use any system
APIs that use wchar_ts. Fortunately, very few do. You're only
likely to run into them in the STL, and you can work around the
problem there by building your own copy of the STL that's compiled
with -fshort-wchar.
This is very helpful information. Thanks for posting it. I
encourage you to get this into the "Switching from XCode to
CodeWarrior" document on the ADC site:
http://developer.apple.com/tools/switchtoxcode.html
or perhaps
http://developer.apple.com/documentation/DeveloperTools/Conceptual/
MovingProjectsToXcode/index.html
I have about as much control over that site as you do. :) If you think
this belongs there, I'd suggest filing a bug report. (I'm not sure
it's appropriate there, by the way. CodeWarrior projects typically
bring along their own copy of Metrowerks' C++ library, which probably
gets rebuilt with two-byte wchars when you change this flag there.
This isn't the case in Xcode.)
Also - as others have noted, the lack of wchar supported library in
10.2 is a show-stopper for us moving to XCode for one of our very
large cross-platform products. I'd really like to see apple provide
a version of the wchar support library for 10.2 as a redistributable
library we can install with our application (or go ahead and put it on
every machine with software update - even better! :-). This would
allow us to move to XCode a year or two earlier (since apple charges
for the 10.2->10.3 upgrade we cannot require customers to make this
upgrade and have to support 10.2 at least).
I think that's very unlikely at this point, but since that's another
thing on which I have no influence, I'd suggest filing another bug
report. :)
The biggest problem here is that wchar support involves changes to
libSystem. It'd be nightmarish to have a supported configuration
involving having a second libSystem installed. Your best bet if you
need 10.2 compatibility is to avoid the wchar APIs (which you should do
in general anyway because they're poorly designed APIs; CF's string
support is much better) and/or implement your own version of them.
-Eric
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.