Re: NDEBUG suddenly defined???
Re: NDEBUG suddenly defined???
- Subject: Re: NDEBUG suddenly defined???
- From: Scott Ribe <email@hidden>
- Date: Tue, 02 Jul 2013 18:50:46 -0600
On Jul 2, 2013, at 3:47 PM, Fritz Anderson wrote:
> Three things, to be tried in any order you please:
>
> Add a Run Script phase to your project. Put something benign like "echo Hello World!" into the script body, and check "Show environment variables in build log." Build. Switch to the log navigator. Select the latest build. Select the run-script step, and click the lines-of-code button that will appear on the right. The expanded view will contain a dump of your environment, which you can search (CFLAGS?) for -dNDEBUG.
>
> Expand one of the compiler invocations in the log and see if the -d is there.
>
> Do a global find for NDEBUG, setting the search to include frameworks. It's possible that you're including a header that defines it.
Global find was the answer. A code mod I made indirectly brought in a 3rd-party header which contained this gem:
#ifndef NDEBUG
#define NDEBUG 1
#endif
Which they "have to" do, because later in the code they have:
if (!NDEBUG)
dosomedebugbuildstuff();
That's right, notice the lack of a "#". So, basically, they have constructed their header such that assert can never be used! Somebody needs a lesson the proper use of NDEBUG.
Fortunately, it's only 1 header, and NDEBUG is only checked in two locations, so I fixed it.
--
Scott Ribe
email@hidden
http://www.elevated-dev.com/
(303) 722-0567 voice
_______________________________________________
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