public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* tools/perf compile error: ignoring return value of 'read', declared with attribute warn_unused_result
@ 2009-07-01 23:43 Kevin Winchester
  2009-07-02  7:44 ` Ingo Molnar
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Winchester @ 2009-07-01 23:43 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: LKML

    CC builtin-stat.o
cc1: warnings being treated as errors
builtin-stat.c: In function 'run_perf_stat':
builtin-stat.c:243: error: ignoring return value of 'read', declared with attribute warn_unused_result
builtin-stat.c:256: error: ignoring return value of 'read', declared with attribute warn_unused_result
make: *** [builtin-stat.o] Error 1

Apparently my version of gcc and/or glibc do not agree with -Werror.  Would the fix be as simple as:

    if *read(go_pipe[0], &buf, 1) < 0) {
            perror("Failed to read go_pipe.");
            exit(1);
    }

?

-- 
Kevin Winchester



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

* Re: tools/perf compile error: ignoring return value of 'read', declared with attribute warn_unused_result
  2009-07-01 23:43 tools/perf compile error: ignoring return value of 'read', declared with attribute warn_unused_result Kevin Winchester
@ 2009-07-02  7:44 ` Ingo Molnar
  2009-07-02 23:49   ` Kevin Winchester
  0 siblings, 1 reply; 3+ messages in thread
From: Ingo Molnar @ 2009-07-02  7:44 UTC (permalink / raw)
  To: Kevin Winchester, Frédéric Weisbecker, Peter Zijlstra,
	Paul Mackerras
  Cc: LKML


* Kevin Winchester <kjwinchester@gmail.com> wrote:

>     CC builtin-stat.o
> cc1: warnings being treated as errors
> builtin-stat.c: In function 'run_perf_stat':
> builtin-stat.c:243: error: ignoring return value of 'read', declared with attribute warn_unused_result
> builtin-stat.c:256: error: ignoring return value of 'read', declared with attribute warn_unused_result
> make: *** [builtin-stat.o] Error 1
> 
> Apparently my version of gcc and/or glibc do not agree with -Werror.  Would the fix be as simple as:
> 
>     if *read(go_pipe[0], &buf, 1) < 0) {
>             perror("Failed to read go_pipe.");
>             exit(1);
>     }
> 
> ?

Yeah, that's Ubuntu doing some must-check-warnings via headers, 
right?

Frederic fixed a bug there yesterday - mind checking the latest 
perfcounters code at:

  http://people.redhat.com/mingo/tip.git/README

?

Thanks,

	Ingo

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

* Re: tools/perf compile error: ignoring return value of 'read', declared with attribute warn_unused_result
  2009-07-02  7:44 ` Ingo Molnar
@ 2009-07-02 23:49   ` Kevin Winchester
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin Winchester @ 2009-07-02 23:49 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Frédéric Weisbecker, Peter Zijlstra, Paul Mackerras,
	LKML

Ingo Molnar wrote:
> * Kevin Winchester <kjwinchester@gmail.com> wrote:
> 
>>     CC builtin-stat.o
>> cc1: warnings being treated as errors
>> builtin-stat.c: In function 'run_perf_stat':
>> builtin-stat.c:243: error: ignoring return value of 'read', declared with attribute warn_unused_result
>> builtin-stat.c:256: error: ignoring return value of 'read', declared with attribute warn_unused_result
>> make: *** [builtin-stat.o] Error 1
>>
>> Apparently my version of gcc and/or glibc do not agree with -Werror.  Would the fix be as simple as:
>>
>>     if *read(go_pipe[0], &buf, 1) < 0) {
>>             perror("Failed to read go_pipe.");
>>             exit(1);
>>     }
>>
>> ?
> 
> Yeah, that's Ubuntu doing some must-check-warnings via headers, 
> right?
> 
> Frederic fixed a bug there yesterday - mind checking the latest 
> perfcounters code at:
> 
>   http://people.redhat.com/mingo/tip.git/README
> 
> ?
> 

It's Gentoo, actually, but likely the same issue.  I checked tip/master and it does not show the problem.

Thanks for taking the time to look into it,

-- 
Kevin Winchester

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

end of thread, other threads:[~2009-07-02 23:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-01 23:43 tools/perf compile error: ignoring return value of 'read', declared with attribute warn_unused_result Kevin Winchester
2009-07-02  7:44 ` Ingo Molnar
2009-07-02 23:49   ` Kevin Winchester

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