]> xenbits.xensource.com Git - people/pauldu/xennet.git/commitdiff
Avoid evaluating assertion expressions in free builds
authorPaul Durrant <paul.durrant@citrix.com>
Fri, 22 Jan 2016 16:05:40 +0000 (16:05 +0000)
committerPaul Durrant <paul.durrant@citrix.com>
Fri, 22 Jan 2016 16:05:40 +0000 (16:05 +0000)
The evaluations are pointless and the warnings generated by not evaluating
can be squashed with a couple of #pragmas.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/xennet/assert.h

index 93334ea6df39f75e8c6996088d67acacbfef2bef..f090461cde4fff9a22a768fc4a9b48a49c66cceb 100644 (file)
@@ -126,18 +126,12 @@ __Bug(
 
 #else   // DBG
 
-static FORCEINLINE VOID
-_IgnoreAssertion(
-    IN  BOOLEAN Value
-    )
-{
-    UNREFERENCED_PARAMETER(Value);
-}
+#pragma warning(disable:4100)
+#pragma warning(disable:4189)
 
-#define ASSERT(_EXP)                        \
-        do {                                \
-            _IgnoreAssertion(_EXP);         \
-            __analysis_assume(_EXP);        \
+#define ASSERT(_EXP)                    \
+        do {                            \
+            __analysis_assume(_EXP);    \
         } while (FALSE)
 
 #define ASSERT3U(_X, _OP, _Y)           \