0

I have my wxWidgets client/server application and faced a complicated bug inside wxWidgets network stuff. It's a long story, let's skip it here.

wxWidgets code uses assertion, so I can't catch it as if it was an exception.

Can I suppress assertions while still compiling in debug mode?

Every time assertion happens, there is wxWidget's assertion info window appears, so user needs to press "Continue" or "Abort" button. If I can't catch it (assertion is not an exception), I'd like to suppress it.

user3558897
  • 113
  • 1
  • 8
  • It was wrong to close this question because wxWidgets assertions (`wxASSERT()`, `wxCHECK()`, ...) are quite different from the standard `assert()` macro, even if they are both affected by `NDEBUG`. – VZ. Jan 26 '16 at 18:12

1 Answers1

1

If you are talking about standard assert macro, you can turn it off by defining NDEBUG macro.

If NDEBUG is defined as a macro name at the point in the source code where <cassert> is included, then assert does nothing.

Mr Lister
  • 45,515
  • 15
  • 108
  • 150
Revolver_Ocelot
  • 8,609
  • 3
  • 30
  • 48
  • Thanks, that worked, but unfortunately did not solved my problem with wxWidgets; after suppressed assertion, GUI stops to repaint how it should, and once it even took down openbox. I'll try to find another lib for networking. – user3558897 Jan 25 '16 at 14:37