[RTEMS Project] #2878: src/c/src/lib/libbsp/sparc/shared/can/occan.c:1573: broken error checking ?

RTEMS trac trac at rtems.org
Fri Jan 20 14:14:06 UTC 2017


#2878: src/c/src/lib/libbsp/sparc/shared/can/occan.c:1573: broken error checking ?
---------------------+------------------
 Reporter:  dcb      |      Owner:
     Type:  defect   |     Status:  new
 Priority:  normal   |  Milestone:  4.12
Component:  General  |    Version:  4.11
 Severity:  normal   |   Keywords:
---------------------+------------------
 src/c/src/lib/libbsp/sparc/shared/can/occan.c:1573]: (style) Checking if
 unsigned variable 'speed=pelican_speed_auto(can)' is less than zero.

 Source code is

             if ( (speed=pelican_speed_auto(can)) < 0 ){
                 /* failed */
                 return RTEMS_IO_ERROR;
             }

 but

    unsigned int speed;

 and

 static int pelican_speed_auto(occan_priv *priv);

 I am not sure which C compiler gets using in rtems, but I do
 know that gcc compiler flag -Wtype-limits will flag this
 kind of problem.

--
Ticket URL: <http://devel.rtems.org/ticket/2878>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list