#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:
Blocking:

Description

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 Jan 19, 2017 at 8:01:25 PM by David Binderman

Still broken some eight months later.

comment:2 Changed on Jan 19, 2017 at 8:38:58 PM 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.