From 4047bd09dae097405d34cc59cf5a7e5ff7faa75a Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Fri, 18 Dec 2015 09:57:23 -0500 Subject: [PATCH] define _DEFAULT_SOURCE as well as _BSD_SOURCE for glibc version 2.20 and up in recent versions of feature_test_macros(7), it says of _BSD_SOURCE: Since glibc 2.20, this macro is deprecated. It now has the same effect as defining _DEFAULT_SOURCE, but generates a compile-time warning (unless _DEFAULT_SOURCE is also defined). Use _DEFAULT_SOURCE instead. To allow code that requires _BSD_SOURCE in glibc 2.19 and earlier and _DEFAULT_SOURCE in glibc 2.20 and later to compile without warnings, define both _BSD_SOURCE and _DEFAULT_SOURCE. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 4b0ed882..dcae8b46 100644 --- a/configure.ac +++ b/configure.ac @@ -98,7 +98,7 @@ AX_CHECK_COMPILE_FLAG([-xc99],[CFLAGS="$CFLAGS -xc99"],[],[]) AX_CHECK_COMPILE_FLAG([-Wall],[CFLAGS="$CFLAGS -Wall"],[],[]) case "$host_os" in - linux* ) CFLAGS="$CFLAGS -D_BSD_SOURCE" + linux* ) CFLAGS="$CFLAGS -D_BSD_SOURCE -D_DEFAULT_SOURCE" ;; solaris* ) CFLAGS="$CFLAGS -D__EXTENSIONS__" # for strdup() from ;;