I'm auditing some source code written with the Qt framework. A typical release build command line output includes QT_NO_DEBUG preprocessor macro, but does not include Posix's NDEBUG preprocessor macro. The Qt documentation on QT_NO_DEBUG does not discuss NDEBUG (I may not have found the correct documentation, btw).
Does Qt's QT_NO_DEBUG cause a definition of Posix's NDEBUG?
No. Add
CONFIG(release, debug|release): DEFINES += NDEBUG
to your .pro file and a test like
{
bool valuesEqual = false;
#ifdef NDEBUG
#ifdef QT_NO_DEBUG
valuesEqual = true;
#endif
#endif
#ifndef NDEBUG
#ifndef QT_NO_DEBUG
valuesEqual = true;
#endif
#endif
EXPECT_TRUE(valuesEqual);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With