[GHC] #11697: rts/posix/Itimer.c: ignoring return value of ‘read’

GHC ghc-devs at haskell.org
Thu Mar 10 21:46:17 UTC 2016


#11697: rts/posix/Itimer.c: ignoring return value of ‘read’
-------------------------------------+-------------------------------------
           Reporter:  erikd          |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Runtime        |           Version:  8.1
  System                             |
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 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 {
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11697>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list