Skip to contentSkip to conversation

scripts: fix warning generated by glibc 2.20

PATCH Applied Lucas Stach 2 participants 2 messages Mar 1, 2015 – Mar 2, 2015 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts: fix warning generated by glibc 2.20

Defining only _BSD_SOURCE is deprecated with version 2.20 of glibc. It has been replaced by _DEFAULT_SOURCE. The manpage says that code which wants to work in the same way on both old and new versions of glibc should simply define both symbols.

Also move the definition up in fix_size as those feature flags should be defined before including any standard headers.

---
 scripts/fix_size.c      | 6 +++---
 scripts/mk-omap-image.c | 1 +
 scripts/mkublheader.c   | 1 +
 3 files changed, 5 insertions(+), 3 deletions(-)
scripts/fix_size.c +3 -3
index c7dcd5ff6b60..7014a3faf611 100644
@@ -1,3 +1,6 @@
+#define _BSD_SOURCE             /* See feature_test_macros(7) */
+#define _DEFAULT_SOURCE
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <sys/types.h>
@@ -6,9 +9,6 @@
 #include <unistd.h>
 #include <stdint.h>
 #include <fcntl.h>
-#ifndef _BSD_SOURCE
-#define _BSD_SOURCE             /* See feature_test_macros(7) */
-#endif
 #include <endian.h>
 
 int main(int argc, char**argv)
scripts/mk-omap-image.c +1 -0
index d0335ad1747d..1d61a34e6507 100644
@@ -34,6 +34,7 @@
  */
 
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 
 #include <stdio.h>
 #include <sys/types.h>
scripts/mkublheader.c +1 -0
index b61630a25fb8..5464a8061176 100644
@@ -19,6 +19,7 @@
  */
 
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 
 #include <stdio.h>
 #include <sys/types.h>
Signature · 7 lines
2.1.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw
Quoted 8 lines · Lucas Stach

Defining only _BSD_SOURCE is deprecated with version 2.20 of glibc. It has been replaced by _DEFAULT_SOURCE. The manpage says that code which wants to work in the same way on both old and new versions of glibc should simply define both symbols.

Also move the definition up in fix_size as those feature flags should be defined before including any standard headers.

Quoted 6 lines
---
 scripts/fix_size.c      | 6 +++---
 scripts/mk-omap-image.c | 1 +
 scripts/mkublheader.c   | 1 +
 3 files changed, 5 insertions(+), 3 deletions(-)

Applied, thanks

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox