cppcheck: Fix problems that are detected with cppcheck 2.19+ - #4602
Merged
Merged
Conversation
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.
More modern versions of cppcheck detect a different set of problems than those in the default builds. Both Ubuntu 26.4 and Fedora 43+ use cppcheck 2.19 and newer. Upgrading the CI container to the newer Ubuntu will also expose these problems and break CI builds.
The fix in
emc/sai/driver.ccis normally never exposed. The tooldata is not handled by NML unless explicitly enabled at configure time. Anyhow, the code was wrong taking the address of the array (not the first element) and casting instead of using the array's name as its pointer.The fix is cosmetic for cppcheck and it is unknown if the TOOL_NML code path actually works. But that is for someone else to examine.