rts/posix/Itimer.c: ignoring return value of ‘read’
Builds currently failing in travis. Eg : https://travis-ci.org/ghc/ghc/jobs/115023819
rts/posix/Itimer.c: In function ‘itimer_thread_func’:
rts/posix/Itimer.c:205:17: error:
error: ignoring return value of ‘read’, declared with attribute
warn_unused_result [-Werror=unused-result]
The code being complained about is:
if (USE_TIMERFD_FOR_ITIMER) {
read(timerfd, &nticks, sizeof(nticks));
} else {
The value of nticks
is never used, so a solution to this may be:
if (USE_TIMERFD_FOR_ITIMER) {
if (read(timerfd, &nticks, sizeof(nticks)) != sizeof(nticks))
nticks = 0;
} else {
This seems to be a warning that only occurs on Ubuntu, because the Ubuntu libc has marked the read
function as warn_unused_result
.