summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2012-01-12 14:14:44 -0700
committerEric Blake <eblake@redhat.com>2012-01-19 13:14:10 -0700
commitd940e3bdb95371c19a99d3d7c043af068cb1590e (patch)
tree28aaa5b98e2ece62ed70ba48fe78fd67d535df59
parentthreads: check for failure to set thread-local value (diff)
downloadlibvirt-d940e3bdb95371c19a99d3d7c043af068cb1590e.tar.gz
libvirt-d940e3bdb95371c19a99d3d7c043af068cb1590e.tar.bz2
libvirt-d940e3bdb95371c19a99d3d7c043af068cb1590e.zip
build: silence some compiler warnings from gnulib
Gnulib claims that there are some classes of warnings that are worth enabling during development, but where silencing those warnings causes code bloat that is not necessary in an optimized build. The code bloat to silence the warnings is only enabled by -Dlint. Follow the lead of coreutils in setting up -Dlint whenever full warnings are requested. * m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): Add -Dlint, and move _FORTIFY_SOURCE to config.h instead of CFLAGS.
-rw-r--r--m4/virt-compile-warnings.m47
1 files changed, 6 insertions, 1 deletions
diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4
index ba388aad1..3a428c32b 100644
--- a/m4/virt-compile-warnings.m4
+++ b/m4/virt-compile-warnings.m4
@@ -100,8 +100,13 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
gl_WARN_ADD([-Wframe-larger-than=4096])
dnl gl_WARN_ADD([-Wframe-larger-than=256])
+ # Silence certain warnings in gnulib, and use improved glibc headers
+ AC_DEFINE([lint], [1],
+ [Define to 1 if the compiler is checking for lint.])
+ AC_DEFINE([_FORTIFY_SOURCE], [2],
+ [enable compile-time and run-time bounds-checking, and some warnings])
+
# Extra special flags
- gl_WARN_ADD([-Wp,-D_FORTIFY_SOURCE=2])
dnl -fstack-protector stuff passes gl_WARN_ADD with gcc
dnl on Mingw32, but fails when actually used
case $host in