RTEMS | Use unsigned type for processor masks (!1096)

Chris Johns (@chris) gitlab at rtems.org
Mon Mar 2 22:42:55 UTC 2026




Chris Johns commented on a discussion on cpukit/include/rtems/score/processormaskimpl.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1096#note_144072

 >    uint32_t              index
 >  )
 >  {
 > -  long bits = mask->__bits[ index / _BITSET_BITS ];
 > +  unsigned long bits = mask->__bits[ index / _BITSET_BITS ];

Sure. However newlib, which this is all based on, is using a [signed value](https://sourceware.org/git/?p=newlib-cygwin.git;a=blob;f=newlib/libc/sys/rtems/include/sys/_bitset.h;h=70b9713ffada31c535b2b37be102dc5e4cddd4a6;hb=HEAD#l49) so if I apply your statement is it's behavior is undefined or implementation-defined as well? I am not sure how fixing our code this way resolves the underlying issue?

I was also not aware of the leaking of newlib code into this low and fundamental level of the `score` and it is a concern. I was not part of discussion this was OK and I have not agreed to this happening previously.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1096#note_144072
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260302/442f9310/attachment.htm>


More information about the bugs mailing list