mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] perf: Fix implicit declaration of getline in util.c
@ 2010-01-16 13:21 Frederic Weisbecker
  2010-01-17  6:58 ` [tip:perf/core] " tip-bot for Frederic Weisbecker
  0 siblings, 1 reply; 2+ messages in thread
From: Frederic Weisbecker @ 2010-01-16 13:21 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: LKML, Frederic Weisbecker, Peter Zijlstra,
	Arnaldo Carvalho de Melo, Paul Mackerras

getline() is considered as undeclared in util/util.c because
it includes string.h, that in turn includes stdio.h, without
having defined _GNU_SOURCE.

But util.c also includes util.h that handles the _GNU_SOURCE and
all the needed inclusions already. Let's include only util.h
and sys/mman.h which is the only one header not handled by util.h

This fixes the following build error:

util/util.c: In function ‘slow_copyfile’:
util/util.c:49: erreur: implicit declaration of function ‘getline’
util/util.c:49: erreur: nested extern declaration of ‘getline’

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
---
 tools/perf/util/util.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index f068584..f9b890f 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -1,10 +1,5 @@
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <string.h>
-#include <unistd.h>
 #include "util.h"
+#include <sys/mman.h>
 
 int mkdir_p(char *path, mode_t mode)
 {
-- 
1.6.2.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [tip:perf/core] perf: Fix implicit declaration of getline in util.c
  2010-01-16 13:21 [PATCH] perf: Fix implicit declaration of getline in util.c Frederic Weisbecker
@ 2010-01-17  6:58 ` tip-bot for Frederic Weisbecker
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Frederic Weisbecker @ 2010-01-17  6:58 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, paulus, acme, hpa, mingo, peterz, fweisbec, tglx, mingo

Commit-ID:  69e3f52d1b1a3ed4390bb8a09bb1324265af7fbf
Gitweb:     http://git.kernel.org/tip/69e3f52d1b1a3ed4390bb8a09bb1324265af7fbf
Author:     Frederic Weisbecker <fweisbec@gmail.com>
AuthorDate: Sat, 16 Jan 2010 14:21:15 +0100
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Sun, 17 Jan 2010 07:53:09 +0100

perf: Fix implicit declaration of getline in util.c

getline() is considered as undeclared in util/util.c because
it includes string.h, that in turn includes stdio.h, without
having defined _GNU_SOURCE.

But util.c also includes util.h that handles the _GNU_SOURCE and
all the needed inclusions already. Let's include only util.h
and sys/mman.h which is the only one header not handled by
util.h

This fixes the following build error:

 util/util.c: In function 'slow_copyfile':
 util/util.c:49: erreur: implicit declaration of function
 'getline' util/util.c:49: erreur: nested extern declaration of 'getline'

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1263648075-3858-1-git-send-regression-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 tools/perf/util/util.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index f068584..f9b890f 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -1,10 +1,5 @@
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <string.h>
-#include <unistd.h>
 #include "util.h"
+#include <sys/mman.h>
 
 int mkdir_p(char *path, mode_t mode)
 {

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-17  7:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-16 13:21 [PATCH] perf: Fix implicit declaration of getline in util.c Frederic Weisbecker
2010-01-17  6:58 ` [tip:perf/core] " tip-bot for Frederic Weisbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome