summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2012-06-07 10:48:05 -0600
committerEric Blake <eblake@redhat.com>2012-06-07 10:52:37 -0600
commit1c2edf0fbd4d20b3955cd5a3d8986413e94fba51 (patch)
treec18f4c9c7a2c7098bd7f080c23699b9d7c7d3be5
parentcommand: avoid potential deadlock on handshake (diff)
downloadlibvirt-1c2edf0fbd4d20b3955cd5a3d8986413e94fba51.tar.gz
libvirt-1c2edf0fbd4d20b3955cd5a3d8986413e94fba51.tar.bz2
libvirt-1c2edf0fbd4d20b3955cd5a3d8986413e94fba51.zip
maint: make it easier to copy FORTIFY_SOURCE snippet
While libvirt intentionally avoids -Wundef (after all, C99 guarantees sane semantics of treating undefined macros as 0), the glibc insanity of #warning on _FORTIFY_SOURCE coupled with what some people feel is the black magic of autoconf means that other projects are likely to copy our snippet verbatim. We can be nicer to other projects by making it easier to integrate into projects that use -Wundef. Suggested by Christophe Fergeau. * m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): Be nice to other projects using -Wundef.
-rw-r--r--m4/virt-compile-warnings.m45
1 files changed, 3 insertions, 2 deletions
diff --git a/m4/virt-compile-warnings.m4 b/m4/virt-compile-warnings.m4
index a91d69f46..18170474d 100644
--- a/m4/virt-compile-warnings.m4
+++ b/m4/virt-compile-warnings.m4
@@ -103,8 +103,9 @@ AC_DEFUN([LIBVIRT_COMPILE_WARNINGS],[
AC_DEFINE([lint], [1],
[Define to 1 if the compiler is checking for lint.])
AH_VERBATIM([FORTIFY_SOURCE],
- [/* Enable compile-time and run-time bounds-checking, and some warnings. */
- #if __OPTIMIZE__
+ [/* Enable compile-time and run-time bounds-checking, and some warnings,
+ without upsetting newer glibc. */
+ #if defined __OPTIMIZE__ && __OPTIMIZE__
# define _FORTIFY_SOURCE 2
#endif
])