From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Markus Trippelsdorf <markus@trippelsdorf.de>,
Namhyung Kim <namhyung.kim@lge.com>
Subject: Re: [PATCH] perf target: Ignore return value of strerror_r() explicitly
Date: Mon, 2 Jul 2012 12:34:26 -0300 [thread overview]
Message-ID: <20120702153426.GC12542@infradead.org> (raw)
In-Reply-To: <1341210014-10113-1-git-send-email-namhyung@kernel.org>
Em Mon, Jul 02, 2012 at 03:20:14PM +0900, Namhyung Kim escreveu:
> Since glibc 2.16 added the warn_unused_result (wur) attribute
> to the function, we should check the return value or ignore it
> explicitly.
>
> Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> +++ b/tools/perf/util/target.c
> @@ -111,7 +111,8 @@ int perf_target__strerror(struct perf_target *target, int errnum,
> const char *msg;
>
> if (errnum >= 0) {
> - strerror_r(errnum, buf, buflen);
> + /* make glibc (>= 2.16) happy */
> + (void)strerror_r(errnum, buf, buflen);
Is this really the best way to handle this?
What if some perf tool is buggy and passes an invalid errnum? Shouldn't
we catch that?
- Arnaldo
next prev parent reply other threads:[~2012-07-02 15:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-02 6:20 Namhyung Kim
2012-07-02 15:34 ` Arnaldo Carvalho de Melo [this message]
2012-07-03 0:28 ` Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120702153426.GC12542@infradead.org \
--to=acme@ghostprotocols.net \
--cc=a.p.zijlstra@chello.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=markus@trippelsdorf.de \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.com \
--cc=namhyung@kernel.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®