[PATCH] perf target: Ignore return value of strerror_r() explicitly

From: Namhyung Kim
Date: Mon Jul 02 2012 - 02:24:56 EST


From: Namhyung Kim <namhyung.kim@xxxxxxx>

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@xxxxxxxxxxxxxxx>
Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
---
tools/perf/util/target.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/target.c b/tools/perf/util/target.c
index 1064d5b148ad..18080ca9ceec 100644
--- a/tools/perf/util/target.c
+++ 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);
return 0;
}

--
1.7.10.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/