* [lttng-dev] [PATCH] urcu: fix deprecation warning with new glibc
@ 2015-06-01 13:16 Marc Kleine-Budde
2015-06-01 14:25 ` Mathieu Desnoyers
0 siblings, 1 reply; 4+ messages in thread
From: Marc Kleine-Budde @ 2015-06-01 13:16 UTC (permalink / raw)
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"
Signed-off-by: Marc Kleine-Budde <mkl at pengutronix.de>
---
urcu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/urcu.c b/urcu.c
index 1429f6dfbbd3..6f5b1e01ea04 100644
--- a/urcu.c
+++ b/urcu.c
@@ -26,6 +26,7 @@
#define _BSD_SOURCE
#define _GNU_SOURCE
#define _LGPL_SOURCE
+#define _DEFAULT_SOURCE
#include <stdio.h>
#include <pthread.h>
#include <signal.h>
--
2.1.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [lttng-dev] [PATCH] urcu: fix deprecation warning with new glibc
2015-06-01 13:16 [lttng-dev] [PATCH] urcu: fix deprecation warning with new glibc Marc Kleine-Budde
@ 2015-06-01 14:25 ` Mathieu Desnoyers
2015-06-01 15:16 ` Marc Kleine-Budde
0 siblings, 1 reply; 4+ messages in thread
From: Mathieu Desnoyers @ 2015-06-01 14:25 UTC (permalink / raw)
----- On Jun 1, 2015, at 3:16 PM, Marc Kleine-Budde mkl at pengutronix.de wrote:
> 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"
And why does this patch just add _DEFAULT_SOURCE without removing _BSD_SOURCE ?
Is it the intended transition path ? Is it documented somewhere ?
Thanks,
Mathieu
>
> Signed-off-by: Marc Kleine-Budde <mkl at pengutronix.de>
> ---
> urcu.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/urcu.c b/urcu.c
> index 1429f6dfbbd3..6f5b1e01ea04 100644
> --- a/urcu.c
> +++ b/urcu.c
> @@ -26,6 +26,7 @@
> #define _BSD_SOURCE
> #define _GNU_SOURCE
> #define _LGPL_SOURCE
> +#define _DEFAULT_SOURCE
> #include <stdio.h>
> #include <pthread.h>
> #include <signal.h>
> --
> 2.1.4
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* [lttng-dev] [PATCH] urcu: fix deprecation warning with new glibc
2015-06-01 14:25 ` Mathieu Desnoyers
@ 2015-06-01 15:16 ` Marc Kleine-Budde
2015-06-01 15:25 ` Mathieu Desnoyers
0 siblings, 1 reply; 4+ messages in thread
From: Marc Kleine-Budde @ 2015-06-01 15:16 UTC (permalink / raw)
On 06/01/2015 04:25 PM, Mathieu Desnoyers wrote:
> ----- On Jun 1, 2015, at 3:16 PM, Marc Kleine-Budde mkl at pengutronix.de wrote:
>
>> 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"
>
> And why does this patch just add _DEFAULT_SOURCE without removing _BSD_SOURCE ?
> Is it the intended transition path ? Is it documented somewhere ?
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 com?
pile-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.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20150601/f0968ea9/attachment.sig>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [lttng-dev] [PATCH] urcu: fix deprecation warning with new glibc
2015-06-01 15:16 ` Marc Kleine-Budde
@ 2015-06-01 15:25 ` Mathieu Desnoyers
0 siblings, 0 replies; 4+ messages in thread
From: Mathieu Desnoyers @ 2015-06-01 15:25 UTC (permalink / raw)
----- On Jun 1, 2015, at 5:16 PM, Marc Kleine-Budde mkl at pengutronix.de wrote:
> On 06/01/2015 04:25 PM, Mathieu Desnoyers wrote:
>> ----- On Jun 1, 2015, at 3:16 PM, Marc Kleine-Budde mkl at pengutronix.de wrote:
>>
>>> 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"
>>
>> And why does this patch just add _DEFAULT_SOURCE without removing _BSD_SOURCE ?
>> Is it the intended transition path ? Is it documented somewhere ?
>
> 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 com?
> pile-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.
Cool, thanks for the patch!
Mathieu
>
> Marc
>
> --
> Pengutronix e.K. | Marc Kleine-Budde |
> Industrial Linux Solutions | Phone: +49-231-2826-924 |
> Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
> Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-06-01 15:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-01 13:16 [lttng-dev] [PATCH] urcu: fix deprecation warning with new glibc Marc Kleine-Budde
2015-06-01 14:25 ` Mathieu Desnoyers
2015-06-01 15:16 ` Marc Kleine-Budde
2015-06-01 15:25 ` Mathieu Desnoyers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox