
#11697: rts/posix/Itimer.c: ignoring return value of ‘read’ -------------------------------------+------------------------------------- Reporter: erikd | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Runtime System | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by erikd: @@ -27,0 +27,3 @@ + + This seems to be a warning that only occurs on Ubuntu, because the Ubuntu + libc has marked the `read` function as `warn_unused_result`. New description: 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`. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11697#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler