Slackware 14.2 uses glibc 2.23 and encounters a warning message about
_BSD_SOURCE deprecated after every compile:
------------------------------------------------------------------------
make[2]: Entering directory '/tmp/SBo/opensmtpd-6.0.2p1/openbsd-compat'
gcc -DHAVE_CONFIG_H -I. -I.. -I../smtpd -I../openbsd-compat
-I/usr/include -O2 -fPIC -fstack-protector -fPIC -DPIC -W
all -Wpointer-arith -Wuninitialized -Wsign-compare -Wformat-security
-Wsizeof-pointer-memaccess -Wno-pointer-sign -Wno-un
used-result -fno-strict-aliasing -fno-builtin-memset -D_BSD_SOURCE -c -o
arc4random.o arc4random.c
In file included from /usr/include/sys/types.h:25:0,
from includes.h:25,
from arc4random.c:27:
/usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and
_SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcp
p]
# warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use
_DEFAULT_SOURCE"
...
------------------------------------------------------------------------
It turns out that if glibc is 2.20 or more then the BSD_SOURCE deprecated
warning appears.
One way of fixing it is to define the _DEFAULT_SOURCE parameter everywhere
the BSD_SOURCE parameter is defined.
https://github.com/alfredh/baresip/issues/93
In portable OpenSMTPD 6.0.2p1 this is in the configure.ac file.
If your distribution is running autoconf 2.69 and automake 1.15
then the best fix is to patch configure.ac and then run autoconfig:
--- configure.ac.orig 2016-10-12 00:16:24.000000000 -0700
+++ configure.ac 2016-12-17 07:35:14.536745127 -0800
@@ -816,7 +816,7 @@
;;
*-*-linux* | *-gnu* | *-k*bsd*-gnu* )
use_pie=auto
- CFLAGS="$CFLAGS -D_BSD_SOURCE"
+ CFLAGS="$CFLAGS -D_BSD_SOURCE -D_DEFAULT_SOURCE"
AC_DEFINE([SPT_TYPE], [SPT_REUSEARGV])
;;
*-*-netbsd*)
-------------------------------------------------------------
BUT if your distribution is not using autoconf 2.69 and autmoake 1.15
then it is safest to patch the configure script and NOT run autoconf:
--- configure.orig 2016-10-12 00:23:35.000000000 -0700
+++ configure 2016-12-17 06:58:06.204780820 -0800
@@ -16725,7 +16725,7 @@
;;
*-*-linux* | *-gnu* | *-k*bsd*-gnu* )
use_pie=auto
- CFLAGS="$CFLAGS -D_BSD_SOURCE"
+ CFLAGS="$CFLAGS -D_BSD_SOURCE -D_DEFAULT_SOURCE"
$as_echo "#define SPT_TYPE SPT_REUSEARGV" >>confdefs.h
;;
--------------------------------------------------------------
-Richard Narron
--
You received this mail because you are subscribed to [email protected]
To unsubscribe, send a mail to: [email protected]