#4228 closed defect (fixed)

rtems_build_name() depends on the signedness of char type

Reported by: Sebastian Huber Owned by: Sebastian Huber
Priority: normal Milestone: 6.1
Component: rtems Version:
Severity: normal Keywords: qualification
Cc: Blocked By:
Blocking:

Description

The rtems_build_name() is implemented by:
{{{!c
#define _Objects_Build_name( _C1, _C2, _C3, _C4 ) \

( (uint32_t)(_C1) << 24 | \

(uint32_t)(_C2) << 16 | \
(uint32_t)(_C3) << 8 | \
(uint32_t)(_C4) )

}}}
If the name is build from four "char" components, then the result depends on the signedness of the char type. The macro should first cast the chars to uint8_t.

Change History (2)

comment:1 Changed on 02/03/21 at 05:17:44 by Sebastian Huber <sebastian.huber@…>

Resolution: fixed
Status: assignedclosed

In 98549e45/rtems:

score: _Objects_Build_name() signed/unsigned char

Change _Objects_Build_name() so that the result is independent of the
signedness of char.

Close #4228.

comment:2 Changed on 06/23/21 at 07:07:55 by Sebastian Huber

Keywords: qualification added
Note: See TracTickets for help on using tickets.