static checker: Make static checker opt-out rather than opt-in
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 24 Oct 2024 21:05:40 +0000 (17:05 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 24 Oct 2024 21:05:40 +0000 (17:05 -0400)
Users must explicitly define SIDE_STATIC_CHECK_DISABLE to opt-out from
the libside static checker.

Change-Id: I517303e03d124a94000c2f974c9e55ab646bc87e
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/side/api.h
tests/static-checker/prologue.c
tests/unit/test-sc-cxx.cpp
tests/unit/test-sc.c

index 0fb3d910e8c1516b86671b8d3caa51a1265c00e0..53ea7901ea80bec958d44f1dba6f89fbf3dee489 100644 (file)
 #define side_declare_event _side_declare_event
 
 /*
- * Static checking is opt-in because it might not work on specific
- * compilers and it slows down the preprocessor.
+ * Define SIDE_STATIC_CHECK_DISABLE to opt-out from static checking,
+ * in case it does not work on your specific compiler or slows down
+ * the preprocessor too much.
  */
-#ifdef SIDE_STATIC_CHECK_ENABLE
+#ifndef SIDE_STATIC_CHECK_DISABLE
 # include <side/static-check.h>
-#endif /* SIDE_STATIC_CHECK_ENABLE */
+#endif /* SIDE_STATIC_CHECK_DISABLE */
 
 #endif /* _SIDE_API_H */
index 412b89c7396c20bab9b7459f3e474232b21853cc..70ecd1265379e0c014928451288e31e8c8d2cdac 100644 (file)
@@ -1,2 +1 @@
-#define SIDE_STATIC_CHECK_ENABLE
 #include <side/trace.h>
index c5eacf0de46577058230e9a7a838c1e79a525b13..2f5a469158550552a86b1c505ea02bbea373fa41 100644 (file)
@@ -1,2 +1 @@
-#define SIDE_STATIC_CHECK_ENABLE
 #include "test-cxx.cpp"
index 547e6bcd925f5095ed660535addcc53fd2281bc2..18735189e62b197a6b5d4263ff7d02fa745f341b 100644 (file)
@@ -1,2 +1 @@
-#define SIDE_STATIC_CHECK_ENABLE
 #include "test.c"
This page took 0.024664 seconds and 4 git commands to generate.