aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorJanne Peltonen <janne.peltonen@nokia.com>2020-06-04 00:47:54 +0300
committerMatias Elo <matias.elo@nokia.com>2020-06-04 16:39:27 +0300
commitc6af989da1eb496887724532bfc0eae2c5b63ceb (patch)
tree0027134c1edf5767102955eb3bfa0da326424247 /configure.ac
parent55bf3d3c80a1aaf2f10c6eca5d622c09b6bf727f (diff)
configure: prevent bogus warnings by GCC 10 from failing the build
GCC 10 sometimes gets confused about object sizes and generates bogus warnings. As a workaround, make -Warray-bounds and -Wstringop-overflow not generate errors as part of -Werror when GCC version 10 or later is used. Fixes: https://github.com/OpenDataPlane/odp/issues/959 Signed-off-by: Janne Peltonen <janne.peltonen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac9
1 files changed, 9 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index cdd1f7769..697e4f486 100644
--- a/configure.ac
+++ b/configure.ac
@@ -133,6 +133,15 @@ ODP_CHECK_CFLAG([-Wformat-overflow=0])
# header structures). Generate only warnings on those, not errors.
ODP_CHECK_CFLAG([-Wno-error=address-of-packed-member])
+# GCC 10 sometimes gets confused about object sizes and gives bogus warnings.
+# Make the affected warnings generate only warnings, not errors.
+AS_IF([test "$GCC" == yes],
+ AS_IF([test `$CC -dumpversion` -ge 10],
+ ODP_CHECK_CFLAG([-Wno-error=array-bounds])
+ ODP_CHECK_CFLAG([-Wno-error=stringop-overflow])
+ )
+)
+
ODP_CFLAGS="$ODP_CFLAGS -std=c99"
ODP_CXXFLAGS="$ODP_CXXFLAGS -std=c++11"