aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2020-06-21 12:31:48 +0200
committerMattias Andrée <maandree@kth.se>2020-06-21 12:31:48 +0200
commitb801444251f6c342c3daad2152f9a4f7215ea8ee (patch)
tree1a885c36a5a1fd7ac44b96eb2332434524606c5f /common.h
parentFix CASE macro: tprintf is returns void, so return in separate statement (diff)
downloadsctrace-b801444251f6c342c3daad2152f9a4f7215ea8ee.tar.gz
sctrace-b801444251f6c342c3daad2152f9a4f7215ea8ee.tar.bz2
sctrace-b801444251f6c342c3daad2152f9a4f7215ea8ee.tar.xz
Fix some warnings and move include statement to common.h
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'common.h')
-rw-r--r--common.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/common.h b/common.h
index 672aa37..43edb74 100644
--- a/common.h
+++ b/common.h
@@ -1,4 +1,5 @@
/* See LICENSE file for copyright and license details. */
+#include <asm/unistd.h>
#include <sys/uio.h>
#include <sys/wait.h>
#include <ctype.h>
@@ -12,6 +13,21 @@
#include <string.h>
#include <unistd.h>
+#if defined(__clang__)
+# define FALL_THROUGH __attribute__((fallthrough));
+#else
+# define FALL_THROUGH
+#endif
+
+#if defined(__clang__)
+# pragma clang diagnostic ignored "-Wdisabled-macro-expansion"
+# pragma clang diagnostic ignored "-Wpadded"
+#elif defined(__GNUC__)
+# pragma GCC diagnostic ignored "-Wpadded"
+# pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
+# pragma GCC diagnostic ignored "-Wsuggest-attribute=format"
+#endif
+
#if defined(__linux__)
# include "linux/os.h"
#else