Skip to content

cppcheck: Fix problems that are detected with cppcheck 2.19+ - #4602

Merged
grandixximo merged 1 commit into
LinuxCNC:masterfrom
BsAtHome:fix_cppcheck-2.19
Sep 29, 2026
Merged

grandixximo merged 1 commit into
LinuxCNC:masterfrom
BsAtHome:fix_cppcheck-2.19

Conversation

@BsAtHome

Copy link
Copy Markdown
Contributor

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.cc is 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.

@grandixximo
grandixximo merged commit 66c2b1b into LinuxCNC:master Sep 29, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants