aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lib
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-01-27 18:23:03 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-02-19 22:14:34 +0100
commit4b81f627c6c031f286fec404bf42235847713181 (patch)
treeb37a09fdb9eb5cdb57744519dc669cb743ce8738 /src/nvim/lib
parent06b7561e785afc9ad0bb66b789a450b96605fd97 (diff)
downloadrneovim-4b81f627c6c031f286fec404bf42235847713181.tar.gz
rneovim-4b81f627c6c031f286fec404bf42235847713181.tar.bz2
rneovim-4b81f627c6c031f286fec404bf42235847713181.zip
build/gcc: disable -Warray-bounds entirely #7923
We need to disable -Warray-bounds locally for kbtree.h, but we can't because _Pragma("GCC diagnostic pop") is broken in GCC 5.x+. So this commit disables -Warray-bounds entirely (for GCC only). GCC bug: "_Pragma diagnostic 'ignored' in macro with strict-overflow not suppressing warning fully with -Werror" https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66099 ref https://github.com/neovim/neovim/pull/7083#issuecomment-326323599 closes #7921
Diffstat (limited to 'src/nvim/lib')
-rw-r--r--src/nvim/lib/kbtree.h22
1 files changed, 1 insertions, 21 deletions
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