#define bug in gcc for delta builds?
#define bug in gcc for delta builds?
- Subject: #define bug in gcc for delta builds?
- From: Stephen Northcott <email@hidden>
- Date: Wed, 4 Feb 2009 15:42:01 +0700
I have been using #define _FOO_ to conditionally alter the
compilation of parts of a class.
In the .h file I had something like this..
#ifdef _FOO_
int A = 2;
#else
int A = 2;
int B = -1;
#endif // _FOO_
In the related .cpp file I would use the same value _FOO_ to control
how code behaved with regards accessing A, or A and B.
If we assume that _FOO_ is not defined then...
When stepping through in XCode I noticed that when the class instance
is created it will be created according to _FOO_ being defined, when
it is actually not defined as I stated just above.
However, stepping into a member function the code would act correctly
addressing data as if _FOO_ was not defined.
Obviously this causes a lot of problems. Data is offset, and it makes
no sense to me, and threads / the main program crash!
A clean all will resolve this and things will behave again.
This is happening several times a day with incremental builds, and had
been intermittently troubling me for some time now, without me
actually knowing what was going on.
It certainly seems like a bug to me. But I am also concerned that
perhaps some corruption has crept into my project..
Any advice / comments greatly appreciated.
Kind regards,
Stephen.
_______________________________________________
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