linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* perf tool build error
@ 2010-05-17  3:21 Lin Ming
  2010-05-17 14:54 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: Lin Ming @ 2010-05-17  3:21 UTC (permalink / raw)
  To: mingo, acme; +Cc: lkml

Build perf tool in latest tip tree(17efbf4) fails,

$ gcc --version
gcc (GCC) 4.3.2 20081105 (Red Hat 4.3.2-7)

cc1: warnings being treated as errors
util/newt.c: In function ‘objdump_line__show’:
util/newt.c:252: error: passing argument 1 of ‘SLsmg_printf’ discards qualifiers from pointer target type
util/newt.c:258: error: passing argument 1 of ‘SLsmg_write_nstring’ discards qualifiers from pointer target type
util/newt.c:262: error: passing argument 1 of ‘SLsmg_write_nstring’ discards qualifiers from pointer target type
util/newt.c:264: error: passing argument 1 of ‘SLsmg_write_nstring’ discards qualifiers from pointer target type
util/newt.c: In function ‘setup_browser’:
util/newt.c:998: error: passing argument 3 of ‘SLtt_set_color’ discards qualifiers from pointer target type
util/newt.c:998: error: passing argument 4 of ‘SLtt_set_color’ discards qualifiers from pointer target type
util/newt.c:999: error: passing argument 3 of ‘SLtt_set_color’ discards qualifiers from pointer target type
util/newt.c:999: error: passing argument 4 of ‘SLtt_set_color’ discards qualifiers from pointer target type
util/newt.c:1000: error: passing argument 3 of ‘SLtt_set_color’ discards qualifiers from pointer target type
util/newt.c:1000: error: passing argument 4 of ‘SLtt_set_color’ discards qualifiers from pointer target type
util/newt.c:1001: error: passing argument 3 of ‘SLtt_set_color’ discards qualifiers from pointer target type
util/newt.c:1001: error: passing argument 4 of ‘SLtt_set_color’ discards qualifiers from pointer target type
util/newt.c:1002: error: passing argument 3 of ‘SLtt_set_color’ discards qualifiers from pointer target type
util/newt.c:1002: error: passing argument 4 of ‘SLtt_set_color’ discards qualifiers from pointer target type


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

* Re: perf tool build error
  2010-05-17  3:21 perf tool build error Lin Ming
@ 2010-05-17 14:54 ` Arnaldo Carvalho de Melo
  2010-05-18  1:20   ` Lin Ming
  0 siblings, 1 reply; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-05-17 14:54 UTC (permalink / raw)
  To: Lin Ming; +Cc: mingo, lkml

Em Mon, May 17, 2010 at 11:21:44AM +0800, Lin Ming escreveu:
> Build perf tool in latest tip tree(17efbf4) fails,
> 
> $ gcc --version
> gcc (GCC) 4.3.2 20081105 (Red Hat 4.3.2-7)
 
> cc1: warnings being treated as errors
> util/newt.c: In function ‘objdump_line__show’:
> util/newt.c:252: error: passing argument 1 of ‘SLsmg_printf’ discards qualifiers from pointer target type
> util/newt.c:258: error: passing argument 1 of ‘SLsmg_write_nstring’ discards qualifiers from pointer target type

What distribution is this?

The problem here lies in the slang-devel package, I guess we'll have
to have the following patch, please apply and see if it cures the issue.

The problem doesn't happen at least in slang >= 2.1.4 when we define 
ENABLE_SLFUTURE_CONST, as we do in tools/perf/Makefile, but since we
want to have perf building in as many scenarios as possible, the patch
is needed, please let me know if it works for you and I'll queue it up.

- Arnaldo

diff --git a/tools/perf/util/newt.c b/tools/perf/util/newt.c
index 2001d26..ccb7c5b 100644
--- a/tools/perf/util/newt.c
+++ b/tools/perf/util/newt.c
@@ -14,6 +14,17 @@
 #include "sort.h"
 #include "symbol.h"
 
+#if SLANG_VERSION < 20104
+#define slsmg_printf(msg, args...) SLsmg_printf((char *)msg, ##args)
+#define slsmg_write_nstring(msg, len) SLsmg_write_nstring((char *)msg, len)
+#define sltt_set_color(obj, name, fg, bg) SLtt_set_color(obj,(char *)name,\
+							 (char *)fg, (char *)bg)
+#else
+#define slsmg_printf SLsmg_printf
+#define slsmg_write_nstring SLsmg_write_nstring
+#define sltt_set_color SLtt_set_color
+#endif
+
 struct ui_progress {
 	newtComponent form, scale;
 };
@@ -292,21 +303,21 @@ static int objdump_line__show(struct objdump_line *self, struct list_head *head,
 
 		color = ui_browser__percent_color(percent, current_entry);
 		SLsmg_set_color(color);
-		SLsmg_printf(" %7.2f ", percent);
+		slsmg_printf(" %7.2f ", percent);
 		if (!current_entry)
 			SLsmg_set_color(HE_COLORSET_CODE);
 	} else {
 		int color = ui_browser__percent_color(0, current_entry);
 		SLsmg_set_color(color);
-		SLsmg_write_nstring(" ", 9);
+		slsmg_write_nstring(" ", 9);
 	}
 
 	SLsmg_write_char(':');
-	SLsmg_write_nstring(" ", 8);
+	slsmg_write_nstring(" ", 8);
 	if (!*self->line)
-		SLsmg_write_nstring(" ", width - 18);
+		slsmg_write_nstring(" ", width - 18);
 	else
-		SLsmg_write_nstring(self->line, width - 18);
+		slsmg_write_nstring(self->line, width - 18);
 
 	return 0;
 }
@@ -1054,11 +1065,11 @@ void setup_browser(void)
 	newtInit();
 	newtCls();
 	ui_helpline__puts(" ");
-	SLtt_set_color(HE_COLORSET_TOP, NULL, c->topColorFg, c->topColorBg);
-	SLtt_set_color(HE_COLORSET_MEDIUM, NULL, c->mediumColorFg, c->mediumColorBg);
-	SLtt_set_color(HE_COLORSET_NORMAL, NULL, c->normalColorFg, c->normalColorBg);
-	SLtt_set_color(HE_COLORSET_SELECTED, NULL, c->selColorFg, c->selColorBg);
-	SLtt_set_color(HE_COLORSET_CODE, NULL, c->codeColorFg, c->codeColorBg);
+	sltt_set_color(HE_COLORSET_TOP, NULL, c->topColorFg, c->topColorBg);
+	sltt_set_color(HE_COLORSET_MEDIUM, NULL, c->mediumColorFg, c->mediumColorBg);
+	sltt_set_color(HE_COLORSET_NORMAL, NULL, c->normalColorFg, c->normalColorBg);
+	sltt_set_color(HE_COLORSET_SELECTED, NULL, c->selColorFg, c->selColorBg);
+	sltt_set_color(HE_COLORSET_CODE, NULL, c->codeColorFg, c->codeColorBg);
 }
 
 void exit_browser(bool wait_for_ok)

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

* Re: perf tool build error
  2010-05-17 14:54 ` Arnaldo Carvalho de Melo
@ 2010-05-18  1:20   ` Lin Ming
  0 siblings, 0 replies; 3+ messages in thread
From: Lin Ming @ 2010-05-18  1:20 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: mingo@elte.hu, lkml

On Mon, 2010-05-17 at 22:54 +0800, Arnaldo Carvalho de Melo wrote:
> Em Mon, May 17, 2010 at 11:21:44AM +0800, Lin Ming escreveu:
> > Build perf tool in latest tip tree(17efbf4) fails,
> > 
> > $ gcc --version
> > gcc (GCC) 4.3.2 20081105 (Red Hat 4.3.2-7)
>  
> > cc1: warnings being treated as errors
> > util/newt.c: In function ‘objdump_line__show’:
> > util/newt.c:252: error: passing argument 1 of ‘SLsmg_printf’ discards qualifiers from pointer target type
> > util/newt.c:258: error: passing argument 1 of ‘SLsmg_write_nstring’ discards qualifiers from pointer target type
> 
> What distribution is this?

Fedora 10 32bit.

> 
> The problem here lies in the slang-devel package, I guess we'll have
> to have the following patch, please apply and see if it cures the issue.
> The problem doesn't happen at least in slang >= 2.1.4 when we define 
> ENABLE_SLFUTURE_CONST, as we do in tools/perf/Makefile, but since we
> want to have perf building in as many scenarios as possible, the patch
> is needed, please let me know if it works for you and I'll queue it up.

Yes, it works.

Thanks,
Lin Ming

> 
> - Arnaldo
> 
> diff --git a/tools/perf/util/newt.c b/tools/perf/util/newt.c
> index 2001d26..ccb7c5b 100644
> --- a/tools/perf/util/newt.c
> +++ b/tools/perf/util/newt.c
> @@ -14,6 +14,17 @@
>  #include "sort.h"
>  #include "symbol.h"
>  
> +#if SLANG_VERSION < 20104
> +#define slsmg_printf(msg, args...) SLsmg_printf((char *)msg, ##args)
> +#define slsmg_write_nstring(msg, len) SLsmg_write_nstring((char *)msg, len)
> +#define sltt_set_color(obj, name, fg, bg) SLtt_set_color(obj,(char *)name,\
> +							 (char *)fg, (char *)bg)
> +#else
> +#define slsmg_printf SLsmg_printf
> +#define slsmg_write_nstring SLsmg_write_nstring
> +#define sltt_set_color SLtt_set_color
> +#endif
> +
>  struct ui_progress {
>  	newtComponent form, scale;
>  };
> @@ -292,21 +303,21 @@ static int objdump_line__show(struct objdump_line *self, struct list_head *head,
>  
>  		color = ui_browser__percent_color(percent, current_entry);
>  		SLsmg_set_color(color);
> -		SLsmg_printf(" %7.2f ", percent);
> +		slsmg_printf(" %7.2f ", percent);
>  		if (!current_entry)
>  			SLsmg_set_color(HE_COLORSET_CODE);
>  	} else {
>  		int color = ui_browser__percent_color(0, current_entry);
>  		SLsmg_set_color(color);
> -		SLsmg_write_nstring(" ", 9);
> +		slsmg_write_nstring(" ", 9);
>  	}
>  
>  	SLsmg_write_char(':');
> -	SLsmg_write_nstring(" ", 8);
> +	slsmg_write_nstring(" ", 8);
>  	if (!*self->line)
> -		SLsmg_write_nstring(" ", width - 18);
> +		slsmg_write_nstring(" ", width - 18);
>  	else
> -		SLsmg_write_nstring(self->line, width - 18);
> +		slsmg_write_nstring(self->line, width - 18);
>  
>  	return 0;
>  }
> @@ -1054,11 +1065,11 @@ void setup_browser(void)
>  	newtInit();
>  	newtCls();
>  	ui_helpline__puts(" ");
> -	SLtt_set_color(HE_COLORSET_TOP, NULL, c->topColorFg, c->topColorBg);
> -	SLtt_set_color(HE_COLORSET_MEDIUM, NULL, c->mediumColorFg, c->mediumColorBg);
> -	SLtt_set_color(HE_COLORSET_NORMAL, NULL, c->normalColorFg, c->normalColorBg);
> -	SLtt_set_color(HE_COLORSET_SELECTED, NULL, c->selColorFg, c->selColorBg);
> -	SLtt_set_color(HE_COLORSET_CODE, NULL, c->codeColorFg, c->codeColorBg);
> +	sltt_set_color(HE_COLORSET_TOP, NULL, c->topColorFg, c->topColorBg);
> +	sltt_set_color(HE_COLORSET_MEDIUM, NULL, c->mediumColorFg, c->mediumColorBg);
> +	sltt_set_color(HE_COLORSET_NORMAL, NULL, c->normalColorFg, c->normalColorBg);
> +	sltt_set_color(HE_COLORSET_SELECTED, NULL, c->selColorFg, c->selColorBg);
> +	sltt_set_color(HE_COLORSET_CODE, NULL, c->codeColorFg, c->codeColorBg);
>  }
>  
>  void exit_browser(bool wait_for_ok)


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

end of thread, other threads:[~2010-05-18  1:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-17  3:21 perf tool build error Lin Ming
2010-05-17 14:54 ` Arnaldo Carvalho de Melo
2010-05-18  1:20   ` Lin Ming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).