public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]  perf tools: Add _GNU_SOURCE macro for strndup()
@ 2009-12-02  6:11 Liming Wang
  2009-12-02  8:04 ` Xiao Guangrong
  2009-12-02  8:30 ` [tip:perf/core] perf tools: Fix _GNU_SOURCE macro related strndup() build error tip-bot for Liming Wang
  0 siblings, 2 replies; 4+ messages in thread
From: Liming Wang @ 2009-12-02  6:11 UTC (permalink / raw)
  To: Ingo Molnar, mhiramat, fweisbec; +Cc: peterz, linux-kernel, Liming Wang

strndup is a GNU extension. So add _GNU_SOURCE macro
to avoid compiling error.

Signed-off-by: Liming Wang <liming.wang@windriver.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
---
 tools/perf/util/string.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/tools/perf/util/string.c b/tools/perf/util/string.c
index 0977cf4..ea3eb39 100644
--- a/tools/perf/util/string.c
+++ b/tools/perf/util/string.c
@@ -1,5 +1,8 @@
+#define _GNU_SOURCE
 #include <string.h>
 #include <stdlib.h>
+
+#undef _GNU_SOURCE
 #include "string.h"
 #include "util.h"
 
-- 
1.6.0.3


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

* Re: [PATCH]  perf tools: Add _GNU_SOURCE macro for strndup()
  2009-12-02  8:04 ` Xiao Guangrong
@ 2009-12-02  8:03   ` Wang Liming
  0 siblings, 0 replies; 4+ messages in thread
From: Wang Liming @ 2009-12-02  8:03 UTC (permalink / raw)
  To: Xiao Guangrong; +Cc: Ingo Molnar, mhiramat, fweisbec, peterz, linux-kernel

Xiao Guangrong wrote:
> 
> Liming Wang wrote:
>> strndup is a GNU extension. So add _GNU_SOURCE macro
>> to avoid compiling error.
>>
>> Signed-off-by: Liming Wang <liming.wang@windriver.com>
>> Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
>> ---
>>  tools/perf/util/string.c |    3 +++
>>  1 files changed, 3 insertions(+), 0 deletions(-)
>>
>> diff --git a/tools/perf/util/string.c b/tools/perf/util/string.c
>> index 0977cf4..ea3eb39 100644
>> --- a/tools/perf/util/string.c
>> +++ b/tools/perf/util/string.c
>> @@ -1,5 +1,8 @@
>> +#define _GNU_SOURCE
>>  #include <string.h>
>>  #include <stdlib.h>
>> +
>> +#undef _GNU_SOURCE
> 
> I think those two "#include" can be removed,
> because util.h include it.
Agreed. It's a better method.

Liming Wang
> 
>>  #include "string.h"
>>  #include "util.h"
>>  
> 


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

* Re: [PATCH]  perf tools: Add _GNU_SOURCE macro for strndup()
  2009-12-02  6:11 [PATCH] perf tools: Add _GNU_SOURCE macro for strndup() Liming Wang
@ 2009-12-02  8:04 ` Xiao Guangrong
  2009-12-02  8:03   ` Wang Liming
  2009-12-02  8:30 ` [tip:perf/core] perf tools: Fix _GNU_SOURCE macro related strndup() build error tip-bot for Liming Wang
  1 sibling, 1 reply; 4+ messages in thread
From: Xiao Guangrong @ 2009-12-02  8:04 UTC (permalink / raw)
  To: Liming Wang; +Cc: Ingo Molnar, mhiramat, fweisbec, peterz, linux-kernel



Liming Wang wrote:
> strndup is a GNU extension. So add _GNU_SOURCE macro
> to avoid compiling error.
> 
> Signed-off-by: Liming Wang <liming.wang@windriver.com>
> Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
> ---
>  tools/perf/util/string.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/tools/perf/util/string.c b/tools/perf/util/string.c
> index 0977cf4..ea3eb39 100644
> --- a/tools/perf/util/string.c
> +++ b/tools/perf/util/string.c
> @@ -1,5 +1,8 @@
> +#define _GNU_SOURCE
>  #include <string.h>
>  #include <stdlib.h>
> +
> +#undef _GNU_SOURCE

I think those two "#include" can be removed,
because util.h include it.

>  #include "string.h"
>  #include "util.h"
>  

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

* [tip:perf/core] perf tools: Fix _GNU_SOURCE macro related strndup() build error
  2009-12-02  6:11 [PATCH] perf tools: Add _GNU_SOURCE macro for strndup() Liming Wang
  2009-12-02  8:04 ` Xiao Guangrong
@ 2009-12-02  8:30 ` tip-bot for Liming Wang
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Liming Wang @ 2009-12-02  8:30 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, fweisbec, xiaoguangrong, tglx,
	liming.wang, mingo

Commit-ID:  c19e33aa840e9202ef8d4c93056b59f3edc2208d
Gitweb:     http://git.kernel.org/tip/c19e33aa840e9202ef8d4c93056b59f3edc2208d
Author:     Liming Wang <liming.wang@windriver.com>
AuthorDate: Wed, 2 Dec 2009 14:11:46 +0800
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 2 Dec 2009 09:24:56 +0100

perf tools: Fix _GNU_SOURCE macro related strndup() build error

strndup is a GNU extension. So dont include string.h without
defining _GNU_SOURCE (it results in a compile error otherwise).

Remove these includes as util.h does it already.

Signed-off-by: Liming Wang <liming.wang@windriver.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Cc: peterz@infradead.org
Cc: mhiramat@redhat.com
LKML-Reference: <1259734306-26323-1-git-send-email-liming.wang@windriver.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 tools/perf/util/string.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/string.c b/tools/perf/util/string.c
index 0977cf4..f24a8cc 100644
--- a/tools/perf/util/string.c
+++ b/tools/perf/util/string.c
@@ -1,5 +1,3 @@
-#include <string.h>
-#include <stdlib.h>
 #include "string.h"
 #include "util.h"
 

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

end of thread, other threads:[~2009-12-02  8:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-02  6:11 [PATCH] perf tools: Add _GNU_SOURCE macro for strndup() Liming Wang
2009-12-02  8:04 ` Xiao Guangrong
2009-12-02  8:03   ` Wang Liming
2009-12-02  8:30 ` [tip:perf/core] perf tools: Fix _GNU_SOURCE macro related strndup() build error tip-bot for Liming Wang

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