All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libsensors: Prevent warning with glibc >= 2.20
@ 2019-08-26  8:10 Jean Delvare
  0 siblings, 0 replies; 2+ messages in thread
From: Jean Delvare @ 2019-08-26  8:10 UTC (permalink / raw)
  To: lm-sensors

Since glibc 2.20, the usage of _BSD_SOURCE is deprecated. Fix it like
described here:

https://sourceware.org/glibc/wiki/Release/2.20#Deprecation_of__BSD_SOURCE_and__SVID_SOURCE_feature_macros

Inspired from a similar patch by Wolfram Sang for i2c-tools.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
 lib/init.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- lm-sensors.orig/lib/init.c	2016-08-03 13:25:00.101098040 +0200
+++ lm-sensors/lib/init.c	2016-08-03 13:25:12.934237590 +0200
@@ -20,7 +20,8 @@
 */
 
 /* Needed for scandir() and alphasort() */
-#define _BSD_SOURCE
+#define _BSD_SOURCE 1 /* for glibc < 2.19 */
+#define _DEFAULT_SOURCE 1 /* for glibc >= 2.19 */
 
 #include <sys/types.h>
 #include <sys/stat.h>


-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] libsensors: Prevent warning with glibc >= 2.20
@ 2019-09-02 11:48 Ondřej Lysoněk
  0 siblings, 0 replies; 2+ messages in thread
From: Ondřej Lysoněk @ 2019-09-02 11:48 UTC (permalink / raw)
  To: lm-sensors

Jean Delvare <jdelvare@suse.de> writes:

> Since glibc 2.20, the usage of _BSD_SOURCE is deprecated. Fix it like
> described here:
>
> https://sourceware.org/glibc/wiki/Release/2.20#Deprecation_of__BSD_SOURCE_and__SVID_SOURCE_feature_macros
>
> Inspired from a similar patch by Wolfram Sang for i2c-tools.
>
> Signed-off-by: Jean Delvare <jdelvare@suse.de>
> ---
>  lib/init.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> --- lm-sensors.orig/lib/init.c	2016-08-03 13:25:00.101098040 +0200
> +++ lm-sensors/lib/init.c	2016-08-03 13:25:12.934237590 +0200
> @@ -20,7 +20,8 @@
>  */
>  
>  /* Needed for scandir() and alphasort() */
> -#define _BSD_SOURCE
> +#define _BSD_SOURCE 1 /* for glibc < 2.19 */
> +#define _DEFAULT_SOURCE 1 /* for glibc >= 2.19 */
>  
>  #include <sys/types.h>
>  #include <sys/stat.h>
>
>
> -- 
> Jean Delvare
> SUSE L3 Support

Thanks, Jean! Applied.

Ondřej Lysoněk

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-02 11:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-02 11:48 [PATCH] libsensors: Prevent warning with glibc >= 2.20 Ondřej Lysoněk
  -- strict thread matches above, loose matches on Subject: below --
2019-08-26  8:10 Jean Delvare

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.