glibc/debug
Joseph Myers a4ecc9eb9b 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.
2014-12-10 01:14:48 +00:00
..
Depend * stdlib/bits/stdlib.h: New file. 2005-07-13 06:09:58 +00:00
Makefile Use -Werror by default, add --disable-werror. 2014-12-10 01:14:48 +00:00
Versions Move getlogin_r_chk to login/ subdir. 2013-05-06 15:58:44 -07:00
asprintf_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
backtrace-tst.c Add #include <stdint.h> for uint[32|64]_t usage (except installed headers). 2013-05-16 11:32:54 -05:00
backtrace.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
backtracesyms.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
backtracesymsfd.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
catchsegv.sh Update remaining copyright dates 2014-01-01 22:02:55 +10:00
chk_fail.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
confstr_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
dprintf_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
execinfo.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fdelt_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fgets_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fgets_u_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fgetws_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fgetws_u_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fortify_fail.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fprintf_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
fread_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
fread_u_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
fwprintf_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
getcwd_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
getdomainname_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
getgroups_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
gethostname_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
gets_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
getwd_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
longjmp_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
mbsnrtowcs_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
mbsrtowcs_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
mbstowcs_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
memcpy_chk.c Fix -Wundef warning on PAGE_COPY_THRESHOLD 2014-07-03 01:49:43 +05:30
memmove_chk.c Remove unnecessary include in memmove_chk 2014-06-27 00:01:37 +05:30
mempcpy_chk.c Fix -Wundef warning on PAGE_COPY_THRESHOLD 2014-07-03 01:49:43 +05:30
memset_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
noophooks.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
obprintf_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
pcprofile.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
pcprofiledump.c Update remaining copyright dates 2014-01-01 22:02:55 +10:00
poll_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
ppoll_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
pread64_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
pread_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
printf_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
read_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
readlink_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
readlinkat_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
readonly-area.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
realpath_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
recv_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
recvfrom_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
segfault.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
snprintf_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
sprintf_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
stack_chk_fail.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
stack_chk_fail_local.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
stpcpy_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
stpncpy_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
strcat_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
strcpy_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
strncat_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
strncpy_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
swprintf_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
test-stpcpy_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
test-strcpy_chk.c tests: unify fortification handler logic 2014-02-08 06:58:43 -05:00
tst-backtrace.h Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
tst-backtrace2.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
tst-backtrace3.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
tst-backtrace4.c tst-backtrace4: expand output even on failures 2014-02-08 07:01:38 -05:00
tst-backtrace5.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
tst-backtrace6.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
tst-chk1.c tests: unify fortification handler logic 2014-02-08 06:58:43 -05:00
tst-chk2.c 2004-10-15 Jakub Jelinek <jakub@redhat.com> 2004-10-18 04:17:19 +00:00
tst-chk3.c 2004-10-15 Jakub Jelinek <jakub@redhat.com> 2004-10-18 04:17:19 +00:00
tst-chk4.cc * misc/sys/cdefs.h (__va_arg_pack): Define for GCC 4.3+. 2007-09-15 02:38:04 +00:00
tst-chk5.cc * misc/sys/cdefs.h (__va_arg_pack): Define for GCC 4.3+. 2007-09-15 02:38:04 +00:00
tst-chk6.cc * misc/sys/cdefs.h (__va_arg_pack): Define for GCC 4.3+. 2007-09-15 02:38:04 +00:00
tst-lfschk1.c * posix/bits/unistd.h (pread) [__USE_FILE_OFFSET64]: Use __off64_t 2005-03-20 16:51:05 +00:00
tst-lfschk2.c * posix/bits/unistd.h (pread) [__USE_FILE_OFFSET64]: Use __off64_t 2005-03-20 16:51:05 +00:00
tst-lfschk3.c * posix/bits/unistd.h (pread) [__USE_FILE_OFFSET64]: Use __off64_t 2005-03-20 16:51:05 +00:00
tst-lfschk4.cc * misc/sys/cdefs.h (__va_arg_pack): Define for GCC 4.3+. 2007-09-15 02:38:04 +00:00
tst-lfschk5.cc * misc/sys/cdefs.h (__va_arg_pack): Define for GCC 4.3+. 2007-09-15 02:38:04 +00:00
tst-lfschk6.cc * misc/sys/cdefs.h (__va_arg_pack): Define for GCC 4.3+. 2007-09-15 02:38:04 +00:00
tst-longjmp_chk.c tests: unify fortification handler logic 2014-02-08 06:58:43 -05:00
tst-longjmp_chk2.c tst-longjmp_chk2: add comments/sanity check 2014-03-13 17:05:29 -04:00
tst-longjmp_chk3.c tst-longjmp_chk3: new test for checking sigaltstack edge cases 2014-02-08 06:59:13 -05:00
ttyname_r_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
vasprintf_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
vdprintf_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
vfprintf_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
vfwprintf_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
vprintf_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
vsnprintf_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
vsprintf_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
vswprintf_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
vwprintf_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
warning-nop.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
wcpcpy_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
wcpncpy_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
wcrtomb_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
wcscat_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
wcscpy_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
wcsncat_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
wcsncpy_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
wcsnrtombs_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
wcsrtombs_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
wcstombs_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
wctomb_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
wmemcpy_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
wmemmove_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
wmempcpy_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
wmemset_chk.c Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
wprintf_chk.c Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
xtrace.sh Update remaining copyright dates 2014-01-01 22:02:55 +10:00