Skip to content

tp: fix cppcheck invalidPrintfArgType_uint regressions#3985

Open
grandixximo wants to merge 1 commit intoLinuxCNC:masterfrom
grandixximo:fix_cppcheck_tp_format
Open

tp: fix cppcheck invalidPrintfArgType_uint regressions#3985
grandixximo wants to merge 1 commit intoLinuxCNC:masterfrom
grandixximo:fix_cppcheck_tp_format

Conversation

@grandixximo
Copy link
Copy Markdown
Contributor

@grandixximo grandixximo commented Apr 30, 2026

Summary

  • Restore %d format specifiers in two tp_debug_print calls in src/emc/tp/tp.c. term_cond and motion_type are signed int; %u requires unsigned.
  • Fix was originally applied in b55ad81 but accidentally reverted by PR Add optional S-curve trajectory planner with jerk limiting #3683 (commit 402828c, stale-base rebase clobber).
  • Added inline comments noting field signedness so future rebases do not silently flip them back.

Fixes cppcheck warnings reported by @BsAtHome in #3683 (comment):

emc/tp/tp.c:1709:9: invalidPrintfArgType_uint
emc/tp/tp.c:1724:5: invalidPrintfArgType_uint (x2)

Test plan

  • Builds clean with make -j$(nproc) from src/
  • cppcheck on tp.c no longer reports the three warnings

term_cond and motion_type are signed int (declared in tc_types.h);
%u format specifier requires unsigned int. Restore %d that was
previously fixed in commit b55ad81 but accidentally reverted by
PR LinuxCNC#3683 (commit 402828c, stale-base rebase clobber).

Added inline comments noting the field signedness so future rebases
do not silently flip these specifiers back to %u.

Fixes cppcheck warnings:
  emc/tp/tp.c:1709:9: invalidPrintfArgType_uint
  emc/tp/tp.c:1724:5: invalidPrintfArgType_uint (x2)
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.

1 participant