RE: STL behaving improperly
RE: STL behaving improperly
- Subject: RE: STL behaving improperly
- From: "Cianflone, Chris" <email@hidden>
- Date: Fri, 21 Oct 2005 10:33:01 -0500
- Thread-topic: STL behaving improperly
Title: RE: STL behaving improperly
<<But I would like to emphasize, that this _ ABI issue_ has most likely
nothing to do with the original problem having runtime errors in STL. >>
We have been keeping some Xcode projects in parallel with our CodeWarrior projects since about Xcode 1.2. It wasn't until we moved to Xcode 2.0 (and 2.1), with using gcc 4, that our STL runtime errors suddenly started showing up. After having no clue what was going on I tried a sample Xcode project with some basic STL usage that worked, and started comparing compiler settings. Eventually I narrowed it down to -fshort-enums. Sure enough, even the sample project had runtime errors in STL with this setting on. Coming from CodeWarrior I had no idea that this setting would have had such a problem, especially since the Xcode project had been running successfully up until Xcode 2.0 with gcc 4.
<<This compiler option is not the default in gcc, nor in Xcode. You
shouldn't use it if you don't know what you are doing. >>
As mentioned above, I eventually figured that out the hard way. It was one little setting in a big pile of settings coming over via a imported CodeWarrior project.
<<To answer this, a bit more information is necessary.>>
I agree. As I pointed out in my e-mail, it was a shot in the dark.
Chris
-----Original Message-----
From: xcode-users-bounces+ccianflone=email@hidden on behalf of Andreas Grosam
Sent: Fri 10/21/2005 7:07 AM
To: xcode-Users List
Cc:
Subject: Re: STL behaving improperly
On 21.10.2005, at 08:19, Cianflone, Chris wrote:
> This is a shot in the dark since you didn't give more info about
> "failing at runtime", but I found -fshort-enums was the culprit after
> much trial and error. This had not been a problem in gcc 3, but
> became problematic in gcc 4.
Sidenote:
This compiler option is not the default in gcc, nor in Xcode. You
shouldn't use it if you don't know what you are doing. The same problem
arise when you set options which change the layout or size of structs
and classes, change the size of int, the sign of char and the size of
wchar: you change the ABI which then becomes incompatible with the
standard ABI.
This *is* the same for gcc3, or any other compiler.
But I would like to emphasize, that this _ ABI issue_ has most likely
nothing to do with the original problem having runtime errors in STL.
To answer this, a bit more information is necessary.
Regards
Andreas
> And once I discovered this, I then saw the help text in Xcode:
>
> Make enums only as large as needed for the range of possible values.
> [GCC_SHORT_ENUMS, -fshort-enums]
>
> Warning: this setting generates code that may not binary compatible
> with code generated without this setting or with Mac OS X frameworks.
>
> Chris
>
> -------------
> Chris Cianflone
> MakeMusic, Inc.
> www.makemusic.com
>
>
> -----Original Message-----
> From: xcode-users-bounces+ccianflone=email@hidden
> on behalf of Souvik Bose
> Sent: Fri 10/21/2005 12:50 AM
> To: email@hidden
> Cc:
> Subject: STL behaving improperly
>
> Hi,
>
>
>
> STL code in our XCODE project is failing at runtime whereas the same
> piece of code seems to work in other compilers especially CodeWarrior.
> Are there any known issues on this? If so, then, is there any
> workaround
> to this?
>
>
>
> Any ideas are highly appreciated.
>
>
>
> Thanks
>
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> email@hidden
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden