summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2021-01-08 11:18:35 +0100
committerThomas Haller <thaller@redhat.com>2021-01-08 12:36:55 +0100
commit89f808efcb76621f5bf8696fa823bf5955612a64 (patch)
tree8b38fc6e0a809fe815e3462768040f3ded828486 /m4
parentcd5792a2b3cfa208963a9aaa9181ff95e8d61c8d (diff)
downloadNetworkManager-89f808efcb76621f5bf8696fa823bf5955612a64.tar.gz
build: add comment for disabling "-Wmaybe-uninitialized" with LTO
With LTO it's easy to get "-Wmaybe-uninitialized" false positives. But the warning is useful, we we don't want to disable it altogether. However, while investigating the problem it can be useful to patch it temporarily. Add a code comment that suggests how to do that.
Diffstat (limited to 'm4')
-rw-r--r--m4/compiler_options.m49
1 files changed, 7 insertions, 2 deletions
diff --git a/m4/compiler_options.m4 b/m4/compiler_options.m4
index d390a90cf0..b4b5e78dcc 100644
--- a/m4/compiler_options.m4
+++ b/m4/compiler_options.m4
@@ -62,8 +62,13 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
if test "x$enable_lto" = xyes; then
dnl With LTO and optimizations enabled, gcc 10.2.1-1.fc32 is really
- dnl adamant to warn about correct uses of strncpy. Disable that warning.
+ dnl adamant to warn about correct uses of strncpy. Disable "-Wstringop-overflow".
_CFLAGS_MORE_WARNINGS_DISABLE_LTO="-Wno-stringop-overflow"
+
+ dnl We want to build with "-Wmaybe-uninitialized" enabled. With LTO that
+ dnl can easily lead to false positives. For manual testing, disable the
+ dnl warning here by uncommenting the following line.
+ dnl _CFLAGS_MORE_WARNINGS_DISABLE_LTO="$_CFLAGS_MORE_WARNINGS_DISABLE_LTO -Wno-error=maybe-uninitialized"
else
_CFLAGS_MORE_WARNINGS_DISABLE_LTO=
fi
@@ -102,7 +107,7 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
-Wno-unused-parameter \
; do
dnl GCC 4.4 does not warn when checking for -Wno-* flags (https://gcc.gnu.org/wiki/FAQ#wnowarning)
- _NM_COMPILER_FLAG([-Wall $(printf '%s' "$option" | sed 's/^-Wno-/-W/')], [],
+ _NM_COMPILER_FLAG([-Wall $(printf '%s' "$option" | sed -e 's/^-W\(no-\|no-error=\)/-W/')], [],
[CFLAGS_MORE_WARNINGS="$CFLAGS_MORE_WARNINGS $option"], [])
done
unset option