aboutsummaryrefslogtreecommitdiff
path: root/gdb/configure
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2017-06-17 23:18:20 +0200
committerSimon Marchi <simon.marchi@ericsson.com>2017-06-17 23:18:20 +0200
commit3e019bdc20eb81b91ab5bc774386201b874c0bac (patch)
treefb557b99058e01de70269a3181b6c93753f8a127 /gdb/configure
parentcf0dd6f02cd45d6dbb6bd87dde25dd3ed74eb7d0 (diff)
downloadgdb-3e019bdc20eb81b91ab5bc774386201b874c0bac.zip
gdb-3e019bdc20eb81b91ab5bc774386201b874c0bac.tar.gz
gdb-3e019bdc20eb81b91ab5bc774386201b874c0bac.tar.bz2
gdb: Use -Werror when checking for (un)supported warning flags
In warning.m4, we pass all the warning flags one by one to the compiler to test if they are supported by this particular compiler. If the compiler exits with an error, we conclude that this warning flag is not supported and exclude it. This allows us to use warning flags without having to worry about which versions of which compilers support each flag. clang, by default, only emits a warning if an unknown flag is passed: warning: unknown warning option '-Wfoo' [-Wunknown-warning-option] The result is that we think that all the warning flags we use are supported by clang (they are not), and the compilation fails later when building with -Werror, since the aforementioned warning becomes an error. The fix is to also pass -Werror when probing for supported flags, then we'll correctly get an error when using an unknown warning, and we'll exclude it: error: unknown warning option '-Wfoo' [-Werror,-Wunknown-warning-option] I am not sure why there is a change in a random comment in gdbserver/configure, but I suppose it's a leftfover from a previous patch, so I included it. gdb/ChangeLog: * configure: Re-generate. * warning.m4: Pass -Werror to compiler when checking for supported warning flags. gdb/gdbserver/ChangeLog: * configure: Re-generate.
Diffstat (limited to 'gdb/configure')
-rwxr-xr-xgdb/configure4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/configure b/gdb/configure
index 1f15d5d3..df2747a 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -15222,9 +15222,9 @@ $as_echo_n "checking compiler warning flags... " >&6; }
*)
# Check whether GCC accepts it.
saved_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $wtest"
+ CFLAGS="$CFLAGS -Werror $wtest"
saved_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS $wtest"
+ CXXFLAGS="$CXXFLAGS -Werror $wtest"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */