[Bug 1974] New: libchip/display/disp_hcms29xx.c:333:9: warning: variable 'digit' set but not used

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Wed Nov 30 16:59:24 UTC 2011


https://www.rtems.org/bugzilla/show_bug.cgi?id=1974

           Summary: libchip/display/disp_hcms29xx.c:333:9: warning:
                    variable 'digit' set but not used
           Product: RTEMS
           Version: unknown
          Platform: All
        OS/Version: RTEMS
            Status: NEW
          Severity: minor
          Priority: P3
         Component: misc
        AssignedTo: joel.sherrill at oarcorp.com
        ReportedBy: ralf.corsepius at rtems.org


GCC raises the warning from the subject.

The code in question condenses down to
(c&/src/libchip/display/disp_hcms29xx.c):

<cite>
static rtems_status_code disp_hcms29xx_send_to_display(
   disp_hcms29xx_drv_t *softc_ptr,
   const volatile char *disp_buffer
)  
{
  ...
  int i,digit,ret_cnt;
  ...
       digit = (softc_ptr->disp_param.rotate
               ? DISP_HCMS29XX_DIGIT_CNT-1-i
               : i);
  ...
}
<cite/>

I.e. GCC is right on issuing the warning. However, when removing "digit", the 
(softc_ptr .... ? :) will remain unused (and raise the next warning from GCC).


All this raises a gut feeling in me, there could be more to this code than
"used vars" and something could be wrong/incomplete in this function and lets
me hesitate to remove digit and the (?:) statement.

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the bugs mailing list