diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-07-01 06:37:06 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-07-01 06:49:48 -0400 |
commit | f37a291c527c954df4da568de718ebb36b8261c0 (patch) | |
tree | bb4863fbd185fbfef5f7d28cb4001d59d4123a2d /tools/perf/util/exec_cmd.c | |
parent | 88a69dfbc6ab1e3b51bba8c9103055e21089ebb9 (diff) |
perf_counter tools: Add more warnings and fix/annotate them
Enable -Wextra. This found a few real bugs plus a number
of signed/unsigned type mismatches/uncleanlinesses. It
also required a few annotations
All things considered it was still worth it so lets try with
this enabled for now.
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/exec_cmd.c')
-rw-r--r-- | tools/perf/util/exec_cmd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/util/exec_cmd.c b/tools/perf/util/exec_cmd.c index d39292263153..34a352867382 100644 --- a/tools/perf/util/exec_cmd.c +++ b/tools/perf/util/exec_cmd.c | |||
@@ -1,6 +1,9 @@ | |||
1 | #include "cache.h" | 1 | #include "cache.h" |
2 | #include "exec_cmd.h" | 2 | #include "exec_cmd.h" |
3 | #include "quote.h" | 3 | #include "quote.h" |
4 | |||
5 | #include <string.h> | ||
6 | |||
4 | #define MAX_ARGS 32 | 7 | #define MAX_ARGS 32 |
5 | 8 | ||
6 | extern char **environ; | 9 | extern char **environ; |
@@ -51,7 +54,7 @@ const char *perf_extract_argv0_path(const char *argv0) | |||
51 | slash--; | 54 | slash--; |
52 | 55 | ||
53 | if (slash >= argv0) { | 56 | if (slash >= argv0) { |
54 | argv0_path = strndup(argv0, slash - argv0); | 57 | argv0_path = xstrndup(argv0, slash - argv0); |
55 | return slash + 1; | 58 | return slash + 1; |
56 | } | 59 | } |
57 | 60 | ||