check.h: Cppcheck will be stable by default. Use -DUNSTABLE to make it unstable.

This commit is contained in:
Daniel Marjamäki 2017-06-03 11:18:00 +02:00
parent 1dd1b5606c
commit 7ec3715c57
1 changed files with 7 additions and 6 deletions

View File

@ -32,14 +32,15 @@
#include <string> #include <string>
/** /**
* Cppcheck data can be wrong and you need a to check if that happens to avoid crash/hang * When -DUNSTABLE is used, Cppcheck will be more unstable and can crash
* Using this macro we can make sure that released binaries don't crash/hang but the problem is not hidden * when there is wrong data. This is intended to be used in daca2.
* in debug builds. *
* Use CHECK_WRONG_DATA in checkers when you avoid crashes for wrong data.
*/ */
#ifndef HIDE_WRONG_DATA #ifdef UNSTABLE
#define CHECK_WRONG_DATA(X) (1) // Debug (crash/hang) #define CHECK_WRONG_DATA(X) (1) // crash/hang
#else #else
#define CHECK_WRONG_DATA(X) (X) // Release (don't crash/hang) #define CHECK_WRONG_DATA(X) (X) // don't crash/hang
#endif #endif
namespace tinyxml2 { namespace tinyxml2 {