aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt15
-rw-r--r--runtime/CMakeLists.txt2
-rw-r--r--src/nvim/lib/kbtree.h22
-rw-r--r--src/nvim/syntax.c7
4 files changed, 15 insertions, 31 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 94a78f85c8..f4ff4d5ac3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -250,13 +250,14 @@ if(HAS_DIAG_COLOR_FLAG)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.5")
- # Array-bounds testing is broken in some GCC versions before 4.8.5.
- # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273
- check_c_compiler_flag(-Wno-array-bounds HAS_NO_ARRAY_BOUNDS_FLAG)
- if(HAS_NO_ARRAY_BOUNDS_FLAG)
- add_definitions(-Wno-array-bounds)
- endif()
+ # 1. Array-bounds testing is broken in some GCC versions before 4.8.5.
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273
+ # 2. But _Pragma("...ignored") is broken (unresolved) in GCC 5+:
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66099
+ # So we must disable -Warray-bounds globally for GCC (for kbtree.h, #7083).
+ check_c_compiler_flag(-Wno-array-bounds HAS_NO_ARRAY_BOUNDS_FLAG)
+ if(HAS_NO_ARRAY_BOUNDS_FLAG)
+ add_definitions(-Wno-array-bounds)
endif()
endif()
diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt
index 0172f630cd..b3907fdf37 100644
--- a/runtime/CMakeLists.txt
+++ b/runtime/CMakeLists.txt
@@ -71,7 +71,7 @@ foreach(DF ${DOCFILES})
endforeach()
add_custom_target(helptags
- COMMAND ${CMAKE_COMMAND} -E remove_directory ${GENERATED_RUNTIME_DIR}/doc
+ COMMAND ${CMAKE_COMMAND} -E remove ${GENERATED_RUNTIME_DIR}/doc/*
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PROJECT_SOURCE_DIR}/runtime/doc ${GENERATED_RUNTIME_DIR}/doc
COMMAND "${PROJECT_BINARY_DIR}/bin/nvim"
diff --git a/src/nvim/lib/kbtree.h b/src/nvim/lib/kbtree.h
index a3943054e6..e2688064a8 100644
--- a/src/nvim/lib/kbtree.h
+++ b/src/nvim/lib/kbtree.h
@@ -390,34 +390,14 @@
#define KBTREE_INIT(name, key_t, __cmp, T) \
KBTREE_INIT_IMPL(name, key_t, kbnode_##name##_t, __cmp, T, (sizeof(kbnode_##name##_t)+(2*T)*sizeof(void *)))
-#if (!defined(__clang__) && !defined(__INTEL_COMPILER)) && (__GNUC__ > 4 )
-
-// The index trickery shouldn't be UB anymore,
-// still it is to much for gcc:s -Werror=array-bounds
-# define __KB_PRAGMA_START \
- _Pragma("GCC diagnostic push") \
- _Pragma("GCC diagnostic ignored \"-Warray-bounds\"")
-
-# define __KB_PRAGMA_END \
- _Pragma("GCC diagnostic pop") \
-
-#else
-
-# define __KB_PRAGMA_START
-# define __KB_PRAGMA_END
-
-#endif
-
#define KBTREE_INIT_IMPL(name, key_t, kbnode_t, __cmp, T, ILEN) \
- __KB_PRAGMA_START \
__KB_TREE_T(name, key_t, T) \
__KB_GET_AUX1(name, key_t, kbnode_t, __cmp) \
__KB_GET(name, key_t, kbnode_t) \
__KB_INTERVAL(name, key_t, kbnode_t) \
__KB_PUT(name, key_t, kbnode_t, __cmp, T, ILEN) \
__KB_DEL(name, key_t, kbnode_t, T) \
- __KB_ITR(name, key_t, kbnode_t) \
- __KB_PRAGMA_END
+ __KB_ITR(name, key_t, kbnode_t)
#define KB_DEFAULT_SIZE 512
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index 0a7f703461..c3bc009f6a 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -4968,6 +4968,8 @@ static void syn_cmd_cluster(exarg_T *eap, int syncing)
if (scl_id >= 0) {
syn_combine_list(&SYN_CLSTR(curwin->w_s)[scl_id].scl_list,
&clstr_list, list_op);
+ } else {
+ xfree(clstr_list);
}
got_clstr = true;
}
@@ -5276,8 +5278,9 @@ get_id_list (
break;
}
if (count != 0) {
- EMSG2(_("E408: %s must be first in contains list"), name + 1);
- failed = TRUE;
+ EMSG2(_("E408: %s must be first in contains list"),
+ name + 1);
+ failed = true;
xfree(name);
break;
}