Use unsigned diagnostic translation indexes - #50
Open
Daniiiil1 wants to merge 1 commit into
Open
Conversation
Signed-off-by: Daniil Mordanov <153565951+Daniiiil1@users.noreply.github.com>
Daniiiil1
marked this pull request as ready for review
August 7, 2026 12:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #33.
What changed
uint16_tfor hardware, updater, key/value lookup indexes in the bridge and updater APIuint16_trange validation instead of signedstd::stoi65535CONTRIBUTING.mdWhy
The ROS messages already encode these translation indexes as unsigned 16-bit values, but the bridge and updater retained signed types. Negative IDs are not valid indexes, and the mismatch could narrow or reinterpret values when moving between the updater, generated messages, and bridge. The polynomial comparator could also overflow for valid 16-bit IDs.
Validation
git diff --checkcppcheck --enable=warning,style,performance,portability --std=c++14 --suppress=missingIncludeSystemon the changed bridge C++ filescppcheck --enable=warning,style,performance,portability --std=c99 --suppress=missingIncludeSystemon the changed updater C filesThe local environment does not include ROS 2/colcon, so the ROS package build and gtests were not run locally. This PR remains a draft pending CI or a maintainer ROS workspace build.