assert in release builds

Member
Posts: 64
Joined: 2008.10
Post: #1
I noticed that xcode doesn't remove the asserts from the release build. Is this a bug? I thought that was the whole point of asserts, that they would be removed during release build.
Any work around?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
Add -DNDEBUG to "other C flags" under the release configuration only.

Not really sure why it's not there by default. Feel free to file a bug. http://bugreport.apple.com/
Quote this message in a reply
Member
Posts: 64
Joined: 2008.10
Post: #3
Thanks OneSadCookie, that works!
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #4
(reported)

I've wondered that myself. Chipmunk has a bunch of assert statements and a lot of people just dump the Chipmunk source into their project without knowing to add -DNDEBUG. I've had a number of people complain about that. On the other hand, most of the same people also don't know to disable thumb compilation or use -ffast-math either. (shrugs)

I made a shell script that builds a 3-way static lib with all the correct settings, but people still opt to copy the source files. I guess old habits die hard. Rasp

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Member
Posts: 64
Joined: 2008.10
Post: #5
Skorche Wrote:(reported)

On the other hand, most of the same people also don't know to disable thumb compilation or use -ffast-math either.
Looks like I'm one of those people LOL I never knew -ffast-math existed. I see it mentioned on forums, but only in relation to x86 code.
Quote this message in a reply
Post Reply