linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c-tools: fix feature test macros for glibc >= 2.20
@ 2016-08-03  8:43 Wolfram Sang
  2016-08-03 11:23 ` Jean Delvare
  2016-08-12 18:34 ` Wolfram Sang
  0 siblings, 2 replies; 4+ messages in thread
From: Wolfram Sang @ 2016-08-03  8:43 UTC (permalink / raw)
  To: linux-i2c; +Cc: Jean Delvare, Wolfram Sang

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

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
 tools/i2cbusses.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/i2cbusses.c b/tools/i2cbusses.c
index b3093aa..28e3682 100644
--- a/tools/i2cbusses.c
+++ b/tools/i2cbusses.c
@@ -23,7 +23,8 @@
 */
 
 /* For strdup and snprintf */
-#define _BSD_SOURCE 1
+#define _BSD_SOURCE 1 /* for glibc < 2.19 */
+#define _DEFAULT_SOURCE 1 /* for glibc >= 2.20 */
 
 #include <sys/types.h>
 #include <sys/stat.h>
-- 
2.8.1

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

* Re: [PATCH] i2c-tools: fix feature test macros for glibc >= 2.20
  2016-08-03  8:43 [PATCH] i2c-tools: fix feature test macros for glibc >= 2.20 Wolfram Sang
@ 2016-08-03 11:23 ` Jean Delvare
  2016-08-09 20:40   ` Wolfram Sang
  2016-08-12 18:34 ` Wolfram Sang
  1 sibling, 1 reply; 4+ messages in thread
From: Jean Delvare @ 2016-08-03 11:23 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c

Hi Wolfram,

On Wed,  3 Aug 2016 10:43:56 +0200, Wolfram Sang wrote:
> 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
> 
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
> ---
>  tools/i2cbusses.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/i2cbusses.c b/tools/i2cbusses.c
> index b3093aa..28e3682 100644
> --- a/tools/i2cbusses.c
> +++ b/tools/i2cbusses.c
> @@ -23,7 +23,8 @@
>  */
>  
>  /* For strdup and snprintf */
> -#define _BSD_SOURCE 1
> +#define _BSD_SOURCE 1 /* for glibc < 2.19 */
> +#define _DEFAULT_SOURCE 1 /* for glibc >= 2.20 */

Actually >= 2.19 if I read the web page you mentioned (which has the
same "bug") correctly.

Other than that,

Reviewed-by: Jean Delvare <jdelvare@suse.de>

Again the 3.1 branch would need the same fix.

>  
>  #include <sys/types.h>
>  #include <sys/stat.h>

Thanks,
-- 
Jean Delvare
SUSE L3 Support

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

* Re: [PATCH] i2c-tools: fix feature test macros for glibc >= 2.20
  2016-08-03 11:23 ` Jean Delvare
@ 2016-08-09 20:40   ` Wolfram Sang
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2016-08-09 20:40 UTC (permalink / raw)
  To: Jean Delvare; +Cc: linux-i2c

[-- Attachment #1: Type: text/plain, Size: 650 bytes --]


> >  /* For strdup and snprintf */
> > -#define _BSD_SOURCE 1
> > +#define _BSD_SOURCE 1 /* for glibc < 2.19 */
> > +#define _DEFAULT_SOURCE 1 /* for glibc >= 2.20 */
> 
> Actually >= 2.19 if I read the web page you mentioned (which has the
> same "bug") correctly.

On the web page it is not a bug, because it says "If ... you must
support glibc < 2.19 and glibc >= 2.20 then define all three
unconditionally". This is correct since 2.19 works with both options.

However, I should probably use >= 2.19 and <= 2.19 here.

> Reviewed-by: Jean Delvare <jdelvare@suse.de>
> 
> Again the 3.1 branch would need the same fix.

Yes.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [PATCH] i2c-tools: fix feature test macros for glibc >= 2.20
  2016-08-03  8:43 [PATCH] i2c-tools: fix feature test macros for glibc >= 2.20 Wolfram Sang
  2016-08-03 11:23 ` Jean Delvare
@ 2016-08-12 18:34 ` Wolfram Sang
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2016-08-12 18:34 UTC (permalink / raw)
  To: linux-i2c; +Cc: Jean Delvare

[-- Attachment #1: Type: text/plain, Size: 361 bytes --]

On Wed, Aug 03, 2016 at 10:43:56AM +0200, Wolfram Sang wrote:
> 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
> 
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>

Pushed to master and 3.1-branch.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2016-08-12 18:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-03  8:43 [PATCH] i2c-tools: fix feature test macros for glibc >= 2.20 Wolfram Sang
2016-08-03 11:23 ` Jean Delvare
2016-08-09 20:40   ` Wolfram Sang
2016-08-12 18:34 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).