]> Git Repo - linux.git/commitdiff
perf: Swap inclusion order of util.h and string.h in util/string.c
authorHitoshi Mitake <[email protected]>
Sun, 4 Apr 2010 08:13:18 +0000 (17:13 +0900)
committerFrederic Weisbecker <[email protected]>
Sun, 4 Apr 2010 14:40:42 +0000 (16:40 +0200)
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 <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
LKML-Reference: <1270368798[email protected]>
Signed-off-by: Frederic Weisbecker <[email protected]>
tools/perf/util/string.c

index d4389242cfd7c40884787ebe8c1f9c3ddbf5c13e..0409fc7c0058809f01da646c4d5ee98c21f69b1d 100644 (file)
@@ -1,5 +1,5 @@
-#include "string.h"
 #include "util.h"
+#include "string.h"
 
 #define K 1024LL
 /*
This page took 0.065429 seconds and 4 git commands to generate.