summaryrefslogtreecommitdiff
path: root/lib/compiler.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-08-22 08:17:32 -0400
committerGitHub <noreply@github.com>2018-08-22 08:17:32 -0400
commit1f063a699b8979d1808673341c5365fed01e9b4a (patch)
tree940fe6bd350b036da076654f848ee05ea8085d1e /lib/compiler.h
parentdca5ef30533ab2a7a5573f065537e7a05067bec7 (diff)
parent0e70e6c89d69976cde1b79bba6ac23d233b19566 (diff)
Merge pull request #2884 from opensourcerouting/assorted-20180821
assorted warning fixes
Diffstat (limited to 'lib/compiler.h')
-rw-r--r--lib/compiler.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/compiler.h b/lib/compiler.h
index b19c33f65e..24b8fafd10 100644
--- a/lib/compiler.h
+++ b/lib/compiler.h
@@ -24,6 +24,9 @@
#if __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 5)
# define _RET_NONNULL , returns_nonnull
#endif
+#if __has_attribute(fallthrough)
+# define _FALLTHROUGH __attribute__((fallthrough));
+#endif
# define _CONSTRUCTOR(x) constructor(x)
#elif defined(__GNUC__)
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)
@@ -34,6 +37,9 @@
# define _DESTRUCTOR(x) destructor(x)
# define _ALLOC_SIZE(x) alloc_size(x)
#endif
+#if __GNUC__ >= 7
+# define _FALLTHROUGH __attribute__((fallthrough));
+#endif
#endif
#ifdef __sun
@@ -55,6 +61,9 @@
#ifndef _ALLOC_SIZE
# define _ALLOC_SIZE(x)
#endif
+#ifndef _FALLTHROUGH
+#define _FALLTHROUGH
+#endif
/*
* for warnings on macros, put in the macro content like this: