From: Hitoshi Mitake Date: Sun, 4 Apr 2010 08:13:18 +0000 (+0900) Subject: perf: Swap inclusion order of util.h and string.h in util/string.c X-Git-Tag: v2.6.35-rc1~522^2~120 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8141d0050d76e5695011b5ab577ec66fb51a998c;p=karo-tx-linux.git perf: Swap inclusion order of util.h and string.h in util/string.c 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 Cc: Peter Zijlstra Cc: Paul Mackerras Cc: Arnaldo Carvalho de Melo LKML-Reference: <1270368798-27232-1-git-send-email-mitake@dcl.info.waseda.ac.jp> Signed-off-by: Frederic Weisbecker --- diff --git a/tools/perf/util/string.c b/tools/perf/util/string.c index d4389242cfd7..0409fc7c0058 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 /*