Skip to content

tc6: fix implicit widening of multiplication in pointer offsets#74

Open
tkummermehr wants to merge 1 commit intoMicrochipTech:mainfrom
tkummermehr:static-analysis/widening-async
Open

tc6: fix implicit widening of multiplication in pointer offsets#74
tkummermehr wants to merge 1 commit intoMicrochipTech:mainfrom
tkummermehr:static-analysis/widening-async

Conversation

@tkummermehr
Copy link
Copy Markdown
Collaborator

Summary

Cast num_regs (uint8_t) to size_t before multiplication to avoid implicit widening of the intermediate product. Fixes 2 clang-tidy bugprone-implicit-widening-of-multiplication-result warnings.

Test plan

  • Static analysis re-run confirms warnings eliminated
  • Code logic unchanged (only explicit casts added)

Explicit cast of num_regs (uint8_t) to size_t before multiplication
prevents implicit widening of the intermediate unsigned int product.

Finding: clang-tidy/bugprone-implicit-widening-of-multiplication-result at libtc6/src/tc6.c:1053,1094
@tkummermehr tkummermehr requested a review from SvenSemmler May 4, 2026 09:47
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