Commit 568c7a0e authored by Bernhard Nortmann's avatar Bernhard Nortmann Committed by Siarhei Siamashka
Browse files

fix compiler warnings due to deprecated _BSD_SOURCE

With glibc 2.20 (and newer), defining _BSD_SOURCE (only)
will now generate compiler warnings similar to:

/usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE
and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]

See the glibc 2.20 release notes, https://lwn.net/Articles/611162/

.

This patch adds the required _DEFAULT_SOURCE.
Signed-off-by: default avatarBernhard Nortmann <bernhard.nortmann@web.de>
Acked-by: default avatarSiarhei Siamashka <siarhei.siamashka@gmail.com>
parent ba28ef2b
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
*/ */
/* Needs _BSD_SOURCE for htole and letoh */ /* Needs _BSD_SOURCE for htole and letoh */
/* glibc 2.20+ also requires _DEFAULT_SOURCE */
#define _DEFAULT_SOURCE
#define _BSD_SOURCE #define _BSD_SOURCE
#define _NETBSD_SOURCE #define _NETBSD_SOURCE
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
*/ */
/* Needs _BSD_SOURCE for htole and letoh */ /* Needs _BSD_SOURCE for htole and letoh */
/* glibc 2.20+ also requires _DEFAULT_SOURCE */
#define _DEFAULT_SOURCE
#define _BSD_SOURCE #define _BSD_SOURCE
#include <stdio.h> #include <stdio.h>
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
*/ */
/* needs _BSD_SOURCE for htole and letoh */ /* needs _BSD_SOURCE for htole and letoh */
/* glibc 2.20+ also requires _DEFAULT_SOURCE */
#define _DEFAULT_SOURCE
#define _BSD_SOURCE #define _BSD_SOURCE
#include <errno.h> #include <errno.h>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment