aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/macros.h
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2020-06-19 22:18:30 -0400
committerJames McCoy <jamessan@jamessan.com>2020-08-23 20:59:39 -0400
commit37fa8d3f44acfc0c0af935f7649d6362545c05dc (patch)
tree7d077e8efbc4cf6054362ddd934b21b79f7dd5bf /src/nvim/macros.h
parent8c49e3d50959e24dadd688f56a18f104bd5fd934 (diff)
downloadrneovim-37fa8d3f44acfc0c0af935f7649d6362545c05dc.tar.gz
rneovim-37fa8d3f44acfc0c0af935f7649d6362545c05dc.tar.bz2
rneovim-37fa8d3f44acfc0c0af935f7649d6362545c05dc.zip
Disable -Wimplicit-fallthrough for funcs.generated.h
This is code generated by gperf, so there's nothing we can do about it. The code does have /*FALLTHROUGH*/ comments but clang doesn't recognize them.
Diffstat (limited to 'src/nvim/macros.h')
-rw-r--r--src/nvim/macros.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nvim/macros.h b/src/nvim/macros.h
index 3df7fa768d..0bbaa87aba 100644
--- a/src/nvim/macros.h
+++ b/src/nvim/macros.h
@@ -1,6 +1,8 @@
#ifndef NVIM_MACROS_H
#define NVIM_MACROS_H
+#include "auto/config.h"
+
// EXTERN is only defined in main.c. That's where global variables are
// actually defined and initialized.
#ifndef EXTERN
@@ -203,16 +205,33 @@
# define PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wmissing-prototypes\"")
+# ifdef HAVE_WIMPLICIT_FALLTHROUGH_FLAG
+# define PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH \
+ _Pragma("clang diagnostic push") \
+ _Pragma("clang diagnostic ignored \"-Wimplicit-fallthrough\"")
+# else
+# define PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH \
+ _Pragma("clang diagnostic push")
+# endif
# define PRAGMA_DIAG_POP \
_Pragma("clang diagnostic pop")
#elif defined(__GNUC__)
# define PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wmissing-prototypes\"")
+# ifdef HAVE_WIMPLICIT_FALLTHROUGH_FLAG
+# define PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH \
+ _Pragma("GCC diagnostic push") \
+ _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+# else
+# define PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH \
+ _Pragma("GCC diagnostic push")
+# endif
# define PRAGMA_DIAG_POP \
_Pragma("GCC diagnostic pop")
#else
# define PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES
+# define PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH
# define PRAGMA_DIAG_POP
#endif