RTEMS | cpukit/libmisc: Remove the dead range checks (!1437)
Sebastian Huber (@sebhub)
gitlab at rtems.org
Thu Aug 20 02:21:37 UTC 2026
Sebastian Huber created a merge request: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1437
Project:Branches: sebhub/rtems:fix-stringto-dead-branches to rtems/rtos/rtems:main
Author: Sebastian Huber
Assignee: Sebastian Huber
## Summary
cpukit/libmisc: Remove the dead range checks
The string to integer template checked the range of the value in
every instantiation. Six of the seven integer instantiations use a
conversion method whose type is not wider than the type of the value.
For those the two comparisons were constant and the code behind them
was dead. Coverity reported this as CID 1700407 to CID 1700418.
Emit the range check only where the type of the conversion method is
wider than the type of the value. Every instantiation which sets
STRING_TO_RESULT_TYPE gives the maximum of that type in
STRING_TO_RESULT_MAX. The template compares the two maxima. An
undefined macro drops the check without a diagnostic, so a missing
STRING_TO_RESULT_MAX is an error.
Behaviour is unchanged. Where the two types have the same width, the
conversion method sets ERANGE. The template already turns ERANGE into
RTEMS_INVALID_NUMBER.
Update #5708.
Assisted-by: Claude:claude-opus-5 claude-code
Signed-off-by: Sebastian Huber <sebastian.huber at embedded-brains.de>
## Generative AI
I used Claude Code.
<!-- Default settings, if it is a dropdown it will set after submission -->
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1437
You're receiving this email because of your account on gitlab.rtems.org. Unsubscribe from this thread: https://gitlab.rtems.org/-/sent_notifications/5-a2sn7hkmz9o21fdaiq6ogcsvm-1d/unsubscribe | Manage all notifications: https://gitlab.rtems.org/-/profile/notifications | Help: https://gitlab.rtems.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260820/f9b3e030/attachment.htm>
More information about the bugs
mailing list