mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <dev@lynxeye.de>
To: barebox@lists.infradead.org
Subject: [PATCH] scripts: fix warning generated by glibc 2.20
Date: Sun,  1 Mar 2015 18:53:29 +0100	[thread overview]
Message-ID: <1425232409-16920-1-git-send-email-dev@lynxeye.de> (raw)

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.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
 scripts/fix_size.c      | 6 +++---
 scripts/mk-omap-image.c | 1 +
 scripts/mkublheader.c   | 1 +
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/scripts/fix_size.c b/scripts/fix_size.c
index c7dcd5ff6b60..7014a3faf611 100644
--- a/scripts/fix_size.c
+++ b/scripts/fix_size.c
@@ -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)
diff --git a/scripts/mk-omap-image.c b/scripts/mk-omap-image.c
index d0335ad1747d..1d61a34e6507 100644
--- a/scripts/mk-omap-image.c
+++ b/scripts/mk-omap-image.c
@@ -34,6 +34,7 @@
  */
 
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 
 #include <stdio.h>
 #include <sys/types.h>
diff --git a/scripts/mkublheader.c b/scripts/mkublheader.c
index b61630a25fb8..5464a8061176 100644
--- a/scripts/mkublheader.c
+++ b/scripts/mkublheader.c
@@ -19,6 +19,7 @@
  */
 
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 
 #include <stdio.h>
 #include <sys/types.h>
-- 
2.1.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2015-03-01 17:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-01 17:53 Lucas Stach [this message]
2015-03-02  6:32 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425232409-16920-1-git-send-email-dev@lynxeye.de \
    --to=dev@lynxeye.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox