[crossfire] Re: [Crossfire-cvs] CVS commit: client
Andreas Kirschbaum
kirschbaum at myrealbox.com
Fri Sep 23 17:07:11 CDT 2005
Nicolas Weeger wrote:
>
> It was very intentional that I left in this #define NDEBUG:
>
>
Well, time to do some magic to have make --debug and make --nodebug? :)
>
More seriously, assert are good to have.
Generally speaking, I think assert statements should normally not be
disabled at all, particularly not for release builds: if an assert
statement actually should fail, the program contains a very serious
logic error. Therefore it is not sensible to continue (and probably
crash shortly afterwards without printing a sensible error message).
OTOH, if continuation is possible or even sensible, it should not be an
assert statement but an if statement which then calls LOG(LOG_ERROR,...)
or LOG(LOG_WARNING,...).
>
If you want to put the define back, then please put it between #ifndef
>
WIN32 / #endif :)
I don't think this is a "WIN32" feature. Therefore I'm very reluctant to
add yet another #ifdef WIN32 block.
>
(NDEBUG is defined in Windows during Release build, so redefinition
>
warning)
I fail to see why the compiler should emit a warning at all: the Ansi C
standard explicitly allows macro redefinition if (and only if) the two
definitions are identical (ignoring white space differences). Therefore
I suspect that the WIN32 build system does not define the macro NDEBUG
as the empty string.
More information about the crossfire
mailing list