lkml.org 
[lkml]   [2010]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/4] Swap inclusion order of util.h and string.h in util/string.c
Date
From: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>

Currently util/string.c includes headers in this order: string.h, util.h
But this causes a build error because __USE_GNU definition
is needed for strndup() definition:

% make -j
touch .perf.dev.null
CC util/string.o
cc1: warnings being treated as errors
util/string.c: In function ‘argv_split’:
util/string.c:171: error: implicit declaration of function ‘strndup’
util/string.c:171: error: incompatible implicit declaration of built-in function ‘strndup’

So this patch swaps the headers inclusion order.
util.h defines _GNU_SOURCE, and /usr/include/features.h defines
__USE_GNU as 1 if _GNU_SOURCE is defined.

Signed-off-by: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <1270368798-27232-1-git-send-email-mitake@dcl.info.waseda.ac.jp>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
tools/perf/util/string.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/string.c b/tools/perf/util/string.c
index d438924..0409fc7 100644
--- a/tools/perf/util/string.c
+++ b/tools/perf/util/string.c
@@ -1,5 +1,5 @@
-#include "string.h"
#include "util.h"
+#include "string.h"

#define K 1024LL
/*
--
1.6.2.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-04-04 16:39    [W:0.057 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site