From 7ec3715c5758eaffdbe3ddb4303fb7bec912f9e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 3 Jun 2017 11:18:00 +0200 Subject: [PATCH] check.h: Cppcheck will be stable by default. Use -DUNSTABLE to make it unstable. --- lib/check.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/check.h b/lib/check.h index 968051750..b0f067b20 100644 --- a/lib/check.h +++ b/lib/check.h @@ -32,14 +32,15 @@ #include /** - * Cppcheck data can be wrong and you need a to check if that happens to avoid crash/hang - * Using this macro we can make sure that released binaries don't crash/hang but the problem is not hidden - * in debug builds. + * When -DUNSTABLE is used, Cppcheck will be more unstable and can crash + * when there is wrong data. This is intended to be used in daca2. + * + * Use CHECK_WRONG_DATA in checkers when you avoid crashes for wrong data. */ -#ifndef HIDE_WRONG_DATA -#define CHECK_WRONG_DATA(X) (1) // Debug (crash/hang) +#ifdef UNSTABLE +#define CHECK_WRONG_DATA(X) (1) // crash/hang #else -#define CHECK_WRONG_DATA(X) (X) // Release (don't crash/hang) +#define CHECK_WRONG_DATA(X) (X) // don't crash/hang #endif namespace tinyxml2 {