From: Marc Kleine-Budde Date: Mon, 1 Jun 2015 13:16:30 +0000 (+0200) Subject: urcu: fix deprecation warning with new glibc X-Git-Tag: v0.9.0~58 X-Git-Url: https://git.lttng.org/?p=urcu.git;a=commitdiff_plain;h=82d50e1adc21b8f41e5c51ff0e84db5348bdff7f urcu: fix deprecation warning with new glibc This patch fixes the following warning: /usr/include/features.h:148:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp] # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" From http://man7.org/linux/man-pages/man7/feature_test_macros.7.html: _BSD_SOURCE (deprecated since glibc 2.20) [...] 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. Signed-off-by: Marc Kleine-Budde Signed-off-by: Mathieu Desnoyers --- diff --git a/urcu.c b/urcu.c index 1429f6d..6f5b1e0 100644 --- a/urcu.c +++ b/urcu.c @@ -26,6 +26,7 @@ #define _BSD_SOURCE #define _GNU_SOURCE #define _LGPL_SOURCE +#define _DEFAULT_SOURCE #include #include #include