RTEMS | Warnings in cpukit dev/can (#5388)
Joel Sherrill (@joel)
gitlab at rtems.org
Sat Dec 13 16:18:53 UTC 2025
Joel Sherrill commented on a discussion: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5388#note_137316
Looks like the GCC documentation is wrong or you looked at the likely older documentation that came with your native GCC.
The left hand side (LHS) has a range of 0..255 which clearly cannot exceed the upper limit of a 32 bit value.
C supports letters at the end to make the constant unsigned or a larger type but nothing to shrink the type.
Most of the Wtype-limits warnings were for comparing an unsigned variable to be < 0 which cannot happen.
I would change the macro to add a cast to uint8_t. Something like "((uint8_t) Number)".
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5388#note_137316
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/20251213/0bcc05c2/attachment-0001.htm>
More information about the bugs
mailing list