← Back to team overview

kicad-developers team mailing list archive

Re: DEBUG vs NDEBUG

 

Ahh, the old double negative.  Using !NDEBUG would be ugly but I suppose
it would be effective.  I'm not sure why cmake isn't defining DEBUG for
debug builds.  I thought at one time it did but I could be wrong.

On 6/1/2016 5:38 PM, Simon Richter wrote:
> Hi,
> 
> there was a small hiccup with a missing symbol in Release builds, which
> I also saw in the MSVC builds, and expected to be affecting those only
> because I don't have explicit logic to set DEBUG and NDEBUG in
> CMakeLists.txt, assuming that CMake does that for me.
> 
> CMake does not set DEBUG in Debug builds, but it does set NDEBUG in
> Release builds, which seemed to explain the problem for the most part:
> wxLogTrace() switches on NDEBUG, while the added #ifdef used the DEBUG
> symbol.
> 
> This is not the full story, obviously, because that should only break
> Debug, not Release builds, but nonetheless it is annoying that we have
> two preprocessor symbols with opposite meanings that can get inconsistent.
> 
> Would it make sense to drop DEBUG and just use !NDEBUG everywhere?
> 
>    Simon
> 
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
> 



Follow ups

References