Skip to content

Commit a9072bc

Browse files
committed
perf header: Fix build on old systems
For instance, on Fedora 8: CC /home/acme/git/build/perf/util/header.o cc1: warnings being treated as errors util/header.c: In function ‘write_cpudesc’: util/header.c:281: warning: implicit declaration of function ‘getline’ util/header.c:281: warning: nested extern declaration of ‘getline’ make: *** [/home/acme/git/build/perf/util/header.o] Error 1 make: Leaving directory `/home/acme/git/linux/tools/perf' [acme@localhost linux]$ This happens due to header ordering, in perf util.h sets _GNU_SOURCE, so it must come first. Reported-by: Ingo Molnar <mingo@elte.hu> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-alfra9wao63euguj7gr8jw7e@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 4610e41 commit a9072bc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎tools/perf/util/header.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#define _FILE_OFFSET_BITS 64
22

3+
#include "util.h"
34
#include <sys/types.h>
45
#include <byteswap.h>
56
#include <unistd.h>
@@ -11,7 +12,6 @@
1112

1213
#include "evlist.h"
1314
#include "evsel.h"
14-
#include "util.h"
1515
#include "header.h"
1616
#include "../perf.h"
1717
#include "trace-event.h"

0 commit comments

Comments
 (0)