diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/nvim/CMakeLists.txt | 7 | ||||
-rw-r--r-- | src/nvim/eval.c | 19 | ||||
-rw-r--r-- | src/nvim/ex_docmd.c | 1 | ||||
-rw-r--r-- | src/nvim/log.c | 1 | ||||
-rw-r--r-- | src/nvim/main.c | 1 | ||||
-rw-r--r-- | src/nvim/os/input.c | 1 | ||||
-rw-r--r-- | src/nvim/os/signal.c | 1 | ||||
-rw-r--r-- | src/nvim/ui_client.c | 1 | ||||
-rw-r--r-- | src/nvim/window.c | 2 |
9 files changed, 18 insertions, 16 deletions
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt index 8e17f94abc..b7f9292de1 100755 --- a/src/nvim/CMakeLists.txt +++ b/src/nvim/CMakeLists.txt @@ -182,12 +182,15 @@ foreach(sfile ${CONV_SOURCES}) message(FATAL_ERROR "${sfile} doesn't exist (it was added to CONV_SOURCES)") endif() endforeach() -# xdiff, mpack, lua-cjson: inlined external project, we don't maintain it. #9306 -list(APPEND CONV_SOURCES ${EXTERNAL_SOURCES}) if(NOT MSVC) set_source_files_properties( ${CONV_SOURCES} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-conversion") + + # xdiff, mpack, lua-cjson: inlined external project, we don't maintain it. #9306 + set_source_files_properties( + ${EXTERNAL_SOURCES} PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -Wno-conversion -Wno-missing-noreturn -Wno-missing-format-attribute -Wno-double-promotion") + # gperf generates ANSI-C with incorrect linkage, ignore it. check_c_compiler_flag(-Wstatic-in-inline HAS_WSTATIC_IN_INLINE) if(HAS_WSTATIC_IN_INLINE) diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 7f937a3137..fbbc543893 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -3976,18 +3976,11 @@ static int eval6(char_u **arg, typval_T *rettv, int evaluate, int want_string) f1 = f1 * f2; } else if (op == '/') { // Division by zero triggers error from AddressSanitizer - f1 = (f2 == 0 - ? ( + f1 = (f2 == 0 ? ( #ifdef NAN - f1 == 0 - ? NAN - : + f1 == 0 ? (float_T)NAN : #endif - (f1 > 0 - ? INFINITY - : -INFINITY) - ) - : f1 / f2); + (f1 > 0 ? (float_T)INFINITY : (float_T)-INFINITY)) : f1 / f2); } else { emsg(_("E804: Cannot use '%' with Float")); return FAIL; @@ -5842,15 +5835,15 @@ size_t string2float(const char *const text, float_T *const ret_value) // MS-Windows does not deal with "inf" and "nan" properly if (STRNICMP(text, "inf", 3) == 0) { - *ret_value = INFINITY; + *ret_value = (float_T)INFINITY; return 3; } if (STRNICMP(text, "-inf", 3) == 0) { - *ret_value = -INFINITY; + *ret_value = (float_T)-INFINITY; return 4; } if (STRNICMP(text, "nan", 3) == 0) { - *ret_value = NAN; + *ret_value = (float_T)NAN; return 3; } *ret_value = strtod(text, &s); diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index dab17fc3a4..0dbc9d6b14 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -6629,6 +6629,7 @@ static void ex_quit(exarg_T *eap) /// ":cquit". static void ex_cquit(exarg_T *eap) + FUNC_ATTR_NORETURN { // this does not always pass on the exit code to the Manx compiler. why? getout(eap->addr_count > 0 ? (int)eap->line2 : EXIT_FAILURE); diff --git a/src/nvim/log.c b/src/nvim/log.c index 5539e3d6c5..7d50ecf69e 100644 --- a/src/nvim/log.c +++ b/src/nvim/log.c @@ -282,6 +282,7 @@ static bool do_log_to_file(FILE *log_file, int log_level, const char *context, static bool v_do_log_to_file(FILE *log_file, int log_level, const char *context, const char *func_name, int line_num, bool eol, const char *fmt, va_list args) + FUNC_ATTR_PRINTF(7, 0) { static const char *log_levels[] = { [DEBUG_LOG_LEVEL] = "DEBUG", diff --git a/src/nvim/main.c b/src/nvim/main.c index dec1ae93e7..afb9313cba 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -2099,6 +2099,7 @@ static bool file_owned(const char *fname) /// @param errstr string containing an error message /// @param str string to append to the primary error message, or NULL static void mainerr(const char *errstr, const char *str) + FUNC_ATTR_NORETURN { char *prgname = (char *)path_tail((char_u *)argv0); diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index 54cfaee80a..c6c4990334 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -522,6 +522,7 @@ static bool input_ready(MultiQueue *events) // Exit because of an input read error. static void read_error_exit(void) + FUNC_ATTR_NORETURN { if (silent_mode) { // Normal way to exit for "nvim -es". getout(0); diff --git a/src/nvim/os/signal.c b/src/nvim/os/signal.c index a8bf68a1a2..327ab6bc48 100644 --- a/src/nvim/os/signal.c +++ b/src/nvim/os/signal.c @@ -152,6 +152,7 @@ static char *signal_name(int signum) // NOTE: Avoid unsafe functions, such as allocating memory, they can result in // a deadlock. static void deadly_signal(int signum) + FUNC_ATTR_NORETURN { // Set the v:dying variable. set_vim_var_nr(VV_DYING, 1); diff --git a/src/nvim/ui_client.c b/src/nvim/ui_client.c index 6e45a28e89..e723a30d32 100644 --- a/src/nvim/ui_client.c +++ b/src/nvim/ui_client.c @@ -87,6 +87,7 @@ Object ui_client_handle_redraw(uint64_t channel_id, Array args, Error *error) /// /// This is just a stub. the full version will handle input, resizing, etc void ui_client_execute(uint64_t chan) + FUNC_ATTR_NORETURN { while (true) { loop_poll_events(&main_loop, -1); diff --git a/src/nvim/window.c b/src/nvim/window.c index fb7878c2f4..fa71a08b94 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -836,7 +836,7 @@ void ui_ext_win_position(win_T *wp) FloatConfig c = wp->w_float_config; if (!c.external) { ScreenGrid *grid = &default_grid; - float row = c.row, col = c.col; + Float row = c.row, col = c.col; if (c.relative == kFloatRelativeWindow) { Error dummy = ERROR_INIT; win_T *win = find_window_by_handle(c.window, &dummy); |