← Back to team overview

kicad-developers team mailing list archive

DEBUG vs NDEBUG

 

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

Attachment: signature.asc
Description: OpenPGP digital signature


Follow ups