From patchwork Wed May 8 16:27:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 242611 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 794872C00FC for ; Thu, 9 May 2013 02:28:30 +1000 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ua7Dm-00068l-CF; Wed, 08 May 2013 16:28:02 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ua7Dh-0006DL-Oj; Wed, 08 May 2013 16:27:57 +0000 Received: from smtp.gentoo.org ([140.211.166.183]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ua7DZ-0006BT-J0 for linux-mtd@lists.infradead.org; Wed, 08 May 2013 16:27:50 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id F0E8833BE5C for ; Wed, 8 May 2013 16:27:26 +0000 (UTC) From: Mike Frysinger To: linux-mtd@lists.infradead.org Subject: [PATCH [mtd-utils] 1/3] move _GNU_SOURCE to the main makefile Date: Wed, 8 May 2013 12:27:24 -0400 Message-Id: <1368030446-343-1-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 1.8.2.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130508_122749_734459_6CDA70F1 X-CRM114-Status: GOOD ( 10.80 ) X-Spam-Score: -8.3 (--------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-8.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [140.211.166.183 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org A bunch of utils are relying on _GNU_SOURCE already. The new prompt code uses getline() which is now part of POSIX, but in older versions of glibc, it was behind _GNU_SOURCE as it was a GNU extension. This change doesn't actually tie us to glibc. Only code that uses GNU extensions does that. It just kills warning when using older versions of glibc. Signed-off-by: Mike Frysinger --- Makefile | 2 +- include/xalloc.h | 2 +- mkfs.jffs2.c | 1 - mkfs.ubifs/mkfs.ubifs.h | 2 -- nanddump.c | 1 - nandtest.c | 1 - nandwrite.c | 1 - 7 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index c8d25f2..bf57a13 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ VERSION = 1.5.0 -CPPFLAGS += -I./include -I$(BUILDDIR)/include -I./ubi-utils/include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS) +CPPFLAGS += -D_GNU_SOURCE -I./include -I$(BUILDDIR)/include -I./ubi-utils/include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS) ifeq ($(WITHOUT_XATTR), 1) CPPFLAGS += -DWITHOUT_XATTR diff --git a/include/xalloc.h b/include/xalloc.h index f1cc8d4..532b80f 100644 --- a/include/xalloc.h +++ b/include/xalloc.h @@ -27,6 +27,7 @@ #ifndef __MTD_UTILS_XALLOC_H__ #define __MTD_UTILS_XALLOC_H__ +#include #include #include @@ -84,7 +85,6 @@ static char *xstrdup(const char *s) } #ifdef _GNU_SOURCE -#include __attribute__((unused)) static int xasprintf(char **strp, const char *fmt, ...) diff --git a/mkfs.jffs2.c b/mkfs.jffs2.c index 7ade078..c1b0f0d 100644 --- a/mkfs.jffs2.c +++ b/mkfs.jffs2.c @@ -49,7 +49,6 @@ #define PROGRAM_NAME "mkfs.jffs2" -#define _GNU_SOURCE #include #include #include diff --git a/mkfs.ubifs/mkfs.ubifs.h b/mkfs.ubifs/mkfs.ubifs.h index 01161ef..6030c48 100644 --- a/mkfs.ubifs/mkfs.ubifs.h +++ b/mkfs.ubifs/mkfs.ubifs.h @@ -23,8 +23,6 @@ #ifndef __MKFS_UBIFS_H__ #define __MKFS_UBIFS_H__ -#define _GNU_SOURCE -#define _LARGEFILE64_SOURCE #include #include #include diff --git a/nanddump.c b/nanddump.c index be458c6..85ccd5d 100644 --- a/nanddump.c +++ b/nanddump.c @@ -15,7 +15,6 @@ #define PROGRAM_NAME "nanddump" -#define _GNU_SOURCE #include #include #include diff --git a/nandtest.c b/nandtest.c index 0187b87..3437b57 100644 --- a/nandtest.c +++ b/nandtest.c @@ -1,6 +1,5 @@ #define PROGRAM_NAME "nandtest" -#define _GNU_SOURCE #include #include #include diff --git a/nandwrite.c b/nandwrite.c index de8e7d2..a6b6581 100644 --- a/nandwrite.c +++ b/nandwrite.c @@ -21,7 +21,6 @@ #define PROGRAM_NAME "nandwrite" -#define _GNU_SOURCE #include #include #include