aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/CMakeLists.txt6
-rw-r--r--src/nvim/eval/funcs.c3
-rw-r--r--src/nvim/macros.h19
-rw-r--r--src/nvim/spellfile.c1
4 files changed, 28 insertions, 1 deletions
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt
index c7258dde12..7b4438b896 100644
--- a/src/nvim/CMakeLists.txt
+++ b/src/nvim/CMakeLists.txt
@@ -189,7 +189,11 @@ if(NOT MSVC)
endif()
# tree-sitter: inlined external project, we don't maintain it. #10124
- set_source_files_properties(${TREESITTER_SOURCES} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-conversion -Wno-pedantic -Wno-shadow -Wno-missing-prototypes -Wno-unused-variable")
+ set(TS_FLAGS "-Wno-conversion -Wno-pedantic -Wno-shadow -Wno-missing-prototypes -Wno-unused-variable")
+ if(HAVE_WIMPLICIT_FALLTHROUGH_FLAG)
+ set(TS_FLAGS "${TS_FLAGS} -Wno-implicit-fallthrough")
+ endif()
+ set_source_files_properties(${TREESITTER_SOURCES} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} ${TS_FLAGS}")
endif()
if(NOT "${MIN_LOG_LEVEL}" MATCHES "^$")
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c
index 8e0e420eb0..ac560124bf 100644
--- a/src/nvim/eval/funcs.c
+++ b/src/nvim/eval/funcs.c
@@ -32,6 +32,7 @@
#include "nvim/indent.h"
#include "nvim/indent_c.h"
#include "nvim/lua/executor.h"
+#include "nvim/macros.h"
#include "nvim/mark.h"
#include "nvim/math.h"
#include "nvim/memline.h"
@@ -86,8 +87,10 @@ KHASH_MAP_INIT_STR(functions, VimLFuncDef)
#endif
PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES
+PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH
#include "funcs.generated.h"
PRAGMA_DIAG_POP
+PRAGMA_DIAG_POP
#endif
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
diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c
index 6b9348e55d..a7d26e2a8e 100644
--- a/src/nvim/spellfile.c
+++ b/src/nvim/spellfile.c
@@ -628,6 +628,7 @@ spell_load_file (
case SP_OTHERERROR: {
emsgf(_("E5042: Failed to read spell file %s: %s"),
fname, strerror(ferror(fd)));
+ goto endFAIL;
}
case 0: {
break;