summaryrefslogtreecommitdiff
path: root/src/basic/macro.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-03-25 22:26:13 +0200
committerSven Eden <yamakuzure@gmx.net>2018-08-24 16:47:08 +0200
commit7c9bebfd22b33d026e66227d9b3a2b33d4a3265b (patch)
treeaf84ca96989c9b6ff3cd513dc348a6652abd3b3f /src/basic/macro.h
parentd3bc5662dd8436ea2ddcd49d18a48e9a4818bb44 (diff)
fuzz-unit-file: add __has_feature(memory_sanitizer) when skipping ListenNetlink=
https://clang.llvm.org/docs/MemorySanitizer.html#id5 documents this check as the way to detect MemorySanitizer at compilation time. We only need to skip the test if MemorySanitizer is used. Also, use this condition in cg_slice_to_path(). There, the code that is conditionalized is not harmful in any way (it's just unnecessary), so remove the FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION condition. Fixes #8482.
Diffstat (limited to 'src/basic/macro.h')
-rw-r--r--src/basic/macro.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/basic/macro.h b/src/basic/macro.h
index 3a6fc6f58..8e61ff068 100644
--- a/src/basic/macro.h
+++ b/src/basic/macro.h
@@ -63,6 +63,17 @@
#endif
#endif
+#if !defined(HAS_FEATURE_MEMORY_SANITIZER)
+# if defined(__has_feature)
+# if __has_feature(memory_sanitizer)
+# define HAS_FEATURE_MEMORY_SANITIZER 1
+# endif
+# endif
+# if !defined(HAS_FEATURE_MEMORY_SANITIZER)
+# define HAS_FEATURE_MEMORY_SANITIZER 0
+# endif
+#endif
+
/* Temporarily disable some warnings */
#define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT \
_Pragma("GCC diagnostic push"); \
@@ -427,7 +438,6 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) {
static inline void func##p(type *p) { \
if (*p) \
func(*p); \
- } \
- struct __useless_struct_to_allow_trailing_semicolon__
+ }
#include "log.h"