tools/perf compile error: ignoring return value of 'read', declaredwith attribute warn_unused_result

From: Kevin Winchester
Date: Wed Jul 01 2009 - 19:43:47 EST


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


--
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/