User forums > Using Code::Blocks
HOw to : NDEBUG and how to use it...
(1/1)
toutarrive:
Hello,
I've got problem with using Ndebug... Does someone could indicate me a link to this topic or even trying to sumerize the use of this macro. thanks
thomas:
NDEBUG is the traditional, standard way of removing the assert() macro (look into assert.h). There is nothing magical about it, just define NDEBUG in the project options, that is all.
Every modern C book should contain an explanation (my copy of Kernighan/Ritchie from 1977 does not).
Some library maintainers think they are Smarter than the standard and do their own thing. They sometimes expect RELEASE to be defined, or they expect BUILD to be set to either DEBUG or RELEASE.
That is of course possible, it just isn't very good practice, as it adds complexity that is just not necessary. It requires third parties using the libraries to remember extra stuff when they could have had it a lot easier the standard way.
toutarrive:
Thanks again Thomas.
I'll have a deep look at the assert.h and get more information by myself.
dje:
--- Quote from: thomas on November 08, 2007, 09:40:58 am ---my copy of Kernighan/Ritchie from 1977 does not
--- End quote ---
Are you working on a software books museum ? :D
thomas:
No, that just so happens to be the book I learned C with. It's a horror to read (Unix inventors should not write books...), and the particular edition I have must definitively be ranked #1 in the top ten for books with the ugliest cover. Still, it's a classic, I love it.
Navigation
[0] Message Index
Go to full version