RTEMS | rfs: fix -Wsign-compare warnings (!892)
Prakhar Kumar (@prakhar)
gitlab at rtems.org
Thu Jan 8 09:46:17 UTC 2026
Prakhar Kumar commented on a discussion on cpukit/libfs/src/rfs/rtems-rfs-bitmaps.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/892#note_138125
> if (rc > 0)
> return rc;
>
> - if (bit >= control->size)
> + if (bit < 0 || (size_t)bit >= control->size)
@chris I updated rtems_rfs_bitmap_bit to size_t since it represents a bitmap index and cannot be negative. Also the bit \< 0 checks are no longer required and the signed/unsigned comparison warnings are eliminated. Please let me know if any other changes are to be made.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/892#note_138125
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/20260108/aad6bfdf/attachment.htm>
More information about the bugs
mailing list