#2731 closed defect (fixed)

rtems/c/src/lib/libbsp/arm/raspberrypi/console/console_select.c:98]: (warning) Found calculation inside sizeof().

Reported by: David Binderman Owned by: Gedare Bloom <gedare@…>
Priority: normal Milestone: 4.11.1
Component: unspecified Version: 4.10
Severity: normal Keywords:
Cc: Blocked By:


Source code is

if ( strncmp( opt, "fbcons", sizeof( "fbcons" - 1 ) ) == 0 ) {

Maybe better code

if ( strncmp( opt, "fbcons", sizeof( "fbcons") - 1 ) == 0 ) {

Change History (2)

comment:1 Changed on 01/19/17 at 20:01:25 by David Binderman

Still broken some eight months later.

comment:2 Changed on 01/19/17 at 20:38:58 by Gedare Bloom <gedare@…>

Owner: set to Gedare Bloom <gedare@…>
Resolution: fixed
Status: newclosed

In 21267897368c8598cc294b73d504be54cce3602c/rtems:

raspberrypi: fix math inside of sizeof

Move the subtraction of 1 for terminator outside of
sizeof operator.

Closes #2731.

Note: See TracTickets for help on using tickets.