diff options
author | Joseph Myers <joseph@codesourcery.com> | 2014-12-10 01:14:48 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2014-12-10 01:14:48 +0000 |
commit | a4ecc9eb9b15bc51a1dc4726c06d35eaea74e162 (patch) | |
tree | 82641c7fc5034317ba20ca9a5a1063099de27766 /debug | |
parent | 0f88636c09686b1f8e876bfa88b40bacbcae8c11 (diff) | |
download | glibc-a4ecc9eb9b15bc51a1dc4726c06d35eaea74e162.zip glibc-a4ecc9eb9b15bc51a1dc4726c06d35eaea74e162.tar.gz glibc-a4ecc9eb9b15bc51a1dc4726c06d35eaea74e162.tar.bz2 |
Use -Werror by default, add --disable-werror.
As discussed starting at
<https://sourceware.org/ml/libc-alpha/2014-11/msg00323.html>, this
patch makes the glibc build use -Werror by default to avoid
accidentally adding new warnings to the build. The configure option
--disable-werror can be used to disable this.
-Wno-error=undef is temporarily used because the build isn't clean
regarding -Wundef warnings. The idea is that once the remaining
-Wundef warnings have been cleaned up (in at least one configuration),
-Wno-error=undef will be removed.
I get a clean build and test on x86_64 (GCC 4.9 branch) with this
patch. The expectation is that this may well break the build for some
other configurations, and people seeing such breakage should make
appropriate fixes to fix or suppress the warnings for their
configurations. In some cases that may involve using pragmas as the
right fix (I think that will be right for the -Wno-inline issue for
MIPS I referred to in
<https://sourceware.org/ml/libc-alpha/2012-11/msg00798.html>, for
example), in some cases -Wno-error in sysdeps makefiles (__restore_rt
in MIPS sigaction, for example), in some cases substantive fixes for
the warnings.
Note that if, with a view to listing all the warnings then fixing them
all, you just look for "warning:" in output from building and testing
with --disable-werror, you'll see lots of warnings from the linker
about functions such as tmpnam. Those warnings can be ignored - only
compiler warnings are relevant to -Werror, not linker warnings.
* configure.ac (--disable-werror): New configure option.
(enable_werror): New AC_SUBST.
* configure: Regenerated.
* config.make.in (enable-werror): New variable.
* Makeconfig [$(enable-werror) = yes] (+gccwarn): Add -Werror
-Wno-error=undef.
(+gccwarn-c): Do not use -Werror=implicit-function-declaration.
* manual/install.texi (Configuring and compiling): Document
--disable-werror.
* INSTALL: Regenerated.
* debug/Makefile (CFLAGS-tst-chk1.c): Add -Wno-error.
(CFLAGS-tst-chk2.c): Likewise.
(CFLAGS-tst-chk3.c): Likewise.
(CFLAGS-tst-chk4.cc): Likewise.
(CFLAGS-tst-chk5.cc): Likewise.
(CFLAGS-tst-chk6.cc): Likewise.
(CFLAGS-tst-lfschk1.c): Likewise.
(CFLAGS-tst-lfschk2.c): Likewise.
(CFLAGS-tst-lfschk3.c): Likewise.
(CFLAGS-tst-lfschk4.cc): Likewise.
(CFLAGS-tst-lfschk5.cc): Likewise.
(CFLAGS-tst-lfschk6.cc): Likewise.
Diffstat (limited to 'debug')
-rw-r--r-- | debug/Makefile | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/debug/Makefile b/debug/Makefile index 3ddcd1e..96c21d5 100644 --- a/debug/Makefile +++ b/debug/Makefile @@ -96,19 +96,21 @@ CFLAGS-tst-longjmp_chk3.c = -fexceptions -fasynchronous-unwind-tables CPPFLAGS-tst-longjmp_chk3.c = -D_FORTIFY_SOURCE=1 # We know these tests have problems with format strings, this is what -# we are testing. Disable that warning. -CFLAGS-tst-chk1.c = -Wno-format -CFLAGS-tst-chk2.c = -Wno-format -CFLAGS-tst-chk3.c = -Wno-format -CFLAGS-tst-chk4.cc = -Wno-format -CFLAGS-tst-chk5.cc = -Wno-format -CFLAGS-tst-chk6.cc = -Wno-format -CFLAGS-tst-lfschk1.c = -Wno-format -CFLAGS-tst-lfschk2.c = -Wno-format -CFLAGS-tst-lfschk3.c = -Wno-format -CFLAGS-tst-lfschk4.cc = -Wno-format -CFLAGS-tst-lfschk5.cc = -Wno-format -CFLAGS-tst-lfschk6.cc = -Wno-format +# we are testing. Disable that warning. They also generate warnings +# from warning attributes, which cannot be disabled via pragmas, so +# require -Wno-error to be used. +CFLAGS-tst-chk1.c = -Wno-format -Wno-error +CFLAGS-tst-chk2.c = -Wno-format -Wno-error +CFLAGS-tst-chk3.c = -Wno-format -Wno-error +CFLAGS-tst-chk4.cc = -Wno-format -Wno-error +CFLAGS-tst-chk5.cc = -Wno-format -Wno-error +CFLAGS-tst-chk6.cc = -Wno-format -Wno-error +CFLAGS-tst-lfschk1.c = -Wno-format -Wno-error +CFLAGS-tst-lfschk2.c = -Wno-format -Wno-error +CFLAGS-tst-lfschk3.c = -Wno-format -Wno-error +CFLAGS-tst-lfschk4.cc = -Wno-format -Wno-error +CFLAGS-tst-lfschk5.cc = -Wno-format -Wno-error +CFLAGS-tst-lfschk6.cc = -Wno-format -Wno-error LDLIBS-tst-chk4 = -lstdc++ LDLIBS-tst-chk5 = -lstdc++ LDLIBS-tst-chk6 = -lstdc++ |