From 5970b13ce93a3bb0185f7f3f94de40b6b8c8bdd0 Mon Sep 17 00:00:00 2001 From: Stephane Del Pino <stephane.delpino44@gmail.com> Date: Sat, 9 Jun 2018 00:40:09 +0200 Subject: [PATCH] Fixed Assert macro with NDEBUG flag. --- src/utils/PastisAssert.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/utils/PastisAssert.hpp b/src/utils/PastisAssert.hpp index ea92e3175..90cfe1599 100644 --- a/src/utils/PastisAssert.hpp +++ b/src/utils/PastisAssert.hpp @@ -47,9 +47,8 @@ class AssertError #ifdef NDEBUG -#warning check that this test does not degrade performaces -#define Assert(assertion) \ - if (not (assertion)) false; +// Useless test is there to check syntax even in optimized mode. Costs nothing. +#define Assert(assertion) if (not (assertion)) {} #else // NDEBUG -- GitLab