Skip to content

More clang-tidy fixes - #113

Open
hjmjohnson wants to merge 2 commits into
masterfrom
clang-tidy-fixes
Open

hjmjohnson wants to merge 2 commits into
masterfrom
clang-tidy-fixes

Conversation

@hjmjohnson

Copy link
Copy Markdown
Member

Re-submission of #22, reverted from master on 2026-09-24 so it can be
reviewed before merging. Content is unchanged from the original.

Base: master. Independent: nothing has to land before it.

Commits
  • COMP: Parenthesize some macro parameters
  • BUG: Widen some multiplications that are stored into size_t

Ordering for all the re-submitted work is tracked in #84.

Fixes some clang-tidy bugprone-macro-parentheses warnings.

Would be an issue where an argument that is an expression would evaluated different with different precedence.

(cherry picked from commit 7387fd5)
Fixes many bugprone-implicit-widening-of-multiplication-result warnings.

Here the multiplications were happening in small types (int, usually 32 bit) then stored in large types (size_t, usually 64 bit). The multiplication could have overflowed. Now the multiplication is done with large types and thus less likely to overflow.

(cherry picked from commit 6d06faa)
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