undefined left-shift of negative integer

Gedare Bloom gedare at rtems.org
Tue Aug 16 19:43:55 UTC 2016


I stumbled across some lurking undefined behavior. In score/status.h:81 we have
STATUS_BUILD( STATUS_CLASSIC_SUCCESSFUL, PTHREAD_BARRIER_SERIAL_THREAD )
where PTHREAD_BARRIER_SERIAL_THREAD is defined to -1. This causes ( -1
) << 8 which is undefined behavior.


More information about the devel mailing list