mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 09:26:30 +00:00
Merge pull request #12510 from jamessan/clang-implicit-fallthrough
This commit is contained in:
@@ -267,8 +267,8 @@ else()
|
|||||||
-Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion
|
-Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion
|
||||||
-Wmissing-prototypes)
|
-Wmissing-prototypes)
|
||||||
|
|
||||||
check_c_compiler_flag(-Wimplicit-fallthrough HAS_WIMPLICIT_FALLTHROUGH_FLAG)
|
check_c_compiler_flag(-Wimplicit-fallthrough HAVE_WIMPLICIT_FALLTHROUGH_FLAG)
|
||||||
if(HAS_WIMPLICIT_FALLTHROUGH_FLAG)
|
if(HAVE_WIMPLICIT_FALLTHROUGH_FLAG)
|
||||||
add_compile_options(-Wimplicit-fallthrough)
|
add_compile_options(-Wimplicit-fallthrough)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -60,5 +60,6 @@
|
|||||||
|
|
||||||
#cmakedefine HAVE_EXECINFO_BACKTRACE
|
#cmakedefine HAVE_EXECINFO_BACKTRACE
|
||||||
#cmakedefine HAVE_BUILTIN_ADD_OVERFLOW
|
#cmakedefine HAVE_BUILTIN_ADD_OVERFLOW
|
||||||
|
#cmakedefine HAVE_WIMPLICIT_FALLTHROUGH_FLAG
|
||||||
|
|
||||||
#endif // AUTO_CONFIG_H
|
#endif // AUTO_CONFIG_H
|
||||||
|
@@ -189,7 +189,11 @@ if(NOT MSVC)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# tree-sitter: inlined external project, we don't maintain it. #10124
|
# 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()
|
endif()
|
||||||
|
|
||||||
if(NOT "${MIN_LOG_LEVEL}" MATCHES "^$")
|
if(NOT "${MIN_LOG_LEVEL}" MATCHES "^$")
|
||||||
|
@@ -32,6 +32,7 @@
|
|||||||
#include "nvim/indent.h"
|
#include "nvim/indent.h"
|
||||||
#include "nvim/indent_c.h"
|
#include "nvim/indent_c.h"
|
||||||
#include "nvim/lua/executor.h"
|
#include "nvim/lua/executor.h"
|
||||||
|
#include "nvim/macros.h"
|
||||||
#include "nvim/mark.h"
|
#include "nvim/mark.h"
|
||||||
#include "nvim/math.h"
|
#include "nvim/math.h"
|
||||||
#include "nvim/memline.h"
|
#include "nvim/memline.h"
|
||||||
@@ -86,8 +87,10 @@ KHASH_MAP_INIT_STR(functions, VimLFuncDef)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES
|
PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES
|
||||||
|
PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH
|
||||||
#include "funcs.generated.h"
|
#include "funcs.generated.h"
|
||||||
PRAGMA_DIAG_POP
|
PRAGMA_DIAG_POP
|
||||||
|
PRAGMA_DIAG_POP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
#ifndef NVIM_MACROS_H
|
#ifndef NVIM_MACROS_H
|
||||||
#define NVIM_MACROS_H
|
#define NVIM_MACROS_H
|
||||||
|
|
||||||
|
#include "auto/config.h"
|
||||||
|
|
||||||
// EXTERN is only defined in main.c. That's where global variables are
|
// EXTERN is only defined in main.c. That's where global variables are
|
||||||
// actually defined and initialized.
|
// actually defined and initialized.
|
||||||
#ifndef EXTERN
|
#ifndef EXTERN
|
||||||
@@ -203,16 +205,33 @@
|
|||||||
# define PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES \
|
# define PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES \
|
||||||
_Pragma("clang diagnostic push") \
|
_Pragma("clang diagnostic push") \
|
||||||
_Pragma("clang diagnostic ignored \"-Wmissing-prototypes\"")
|
_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 \
|
# define PRAGMA_DIAG_POP \
|
||||||
_Pragma("clang diagnostic pop")
|
_Pragma("clang diagnostic pop")
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
# define PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES \
|
# define PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES \
|
||||||
_Pragma("GCC diagnostic push") \
|
_Pragma("GCC diagnostic push") \
|
||||||
_Pragma("GCC diagnostic ignored \"-Wmissing-prototypes\"")
|
_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 \
|
# define PRAGMA_DIAG_POP \
|
||||||
_Pragma("GCC diagnostic pop")
|
_Pragma("GCC diagnostic pop")
|
||||||
#else
|
#else
|
||||||
# define PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES
|
# define PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPES
|
||||||
|
# define PRAGMA_DIAG_PUSH_IGNORE_IMPLICIT_FALLTHROUGH
|
||||||
# define PRAGMA_DIAG_POP
|
# define PRAGMA_DIAG_POP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -628,6 +628,7 @@ spell_load_file (
|
|||||||
case SP_OTHERERROR: {
|
case SP_OTHERERROR: {
|
||||||
emsgf(_("E5042: Failed to read spell file %s: %s"),
|
emsgf(_("E5042: Failed to read spell file %s: %s"),
|
||||||
fname, strerror(ferror(fd)));
|
fname, strerror(ferror(fd)));
|
||||||
|
goto endFAIL;
|
||||||
}
|
}
|
||||||
case 0: {
|
case 0: {
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user