aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2018-09-21 11:42:38 +0100
committerEric Engestrom <[email protected]>2018-09-25 11:40:08 +0100
commit97ae5a858d2a2da9144ea9793b67b360a3a7c5fa (patch)
tree3af184b4d0b3e3caa0d31cf6ee862bb6180b5146 /configure.ac
parent1a37a80bf627daf234a139b22678005a6fb48d7e (diff)
meson+autotools: get rid of spammy GCC warning -Wformat-truncation
That warning fires every time a string function takes an argument that could possibly be longer than its max output, which triggers all over the place, especially when working with file paths ("what if every file path is MAX_PATH long?" is what GCC is saying, which is really annoying when we *know* that "/dev/dri/cardN" is not gonna be 4096 char long and it's safe to store it in a 32-char array). Anyway, we either add a ton of dead code all over the place to make GCC happy, or we get rid of its spam. I chose the latter. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac2
1 files changed, 2 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 7583a375ad7..34689826c98 100644
--- a/configure.ac
+++ b/configure.ac
@@ -307,6 +307,7 @@ AX_CHECK_COMPILE_FLAG([-Werror=missing-prototypes], [CFLAGS="$CFLAGS
AX_CHECK_COMPILE_FLAG([-Wmissing-prototypes], [CFLAGS="$CFLAGS -Wmissing-prototypes"])
dnl Dylan Baker: gcc and clang always accepr -Wno-*, hence check for the original warning, then set the no-* flag
AX_CHECK_COMPILE_FLAG([-Wmissing-field-initializers], [CFLAGS="$CFLAGS -Wno-missing-field-initializers"])
+AX_CHECK_COMPILE_FLAG([-Wformat-truncation], [CFLAGS="$CFLAGS -Wno-format-truncation"])
AX_CHECK_COMPILE_FLAG([-fno-math-errno], [CFLAGS="$CFLAGS -fno-math-errno"])
AX_CHECK_COMPILE_FLAG([-fno-trapping-math], [CFLAGS="$CFLAGS -fno-trapping-math"])
@@ -321,6 +322,7 @@ AX_CHECK_COMPILE_FLAG([-fno-math-errno], [CXXFLAGS="$CXXFL
AX_CHECK_COMPILE_FLAG([-fno-trapping-math], [CXXFLAGS="$CXXFLAGS -fno-trapping-math"])
AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [VISIBILITY_CXXFLAGS="-fvisibility=hidden"])
AX_CHECK_COMPILE_FLAG([-Wmissing-field-initializers], [CXXFLAGS="$CXXFLAGS -Wno-missing-field-initializers"])
+AX_CHECK_COMPILE_FLAG([-Wformat-truncation], [CXXFLAGS="$CXXFLAGS -Wno-format-truncation"])
AC_LANG_POP([C++])
# Flags to help ensure that certain portions of the code -- and only those