Skip to content

More clang-tidy fixes - #113

Merged
hjmjohnson merged 2 commits into
masterfrom
clang-tidy-fixes
Oct 6, 2026
Merged

hjmjohnson merged 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.

@hjmjohnson
hjmjohnson marked this pull request as ready for review September 24, 2026 12:17
seanm added 2 commits October 6, 2026 09:34
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)

@seanm seanm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was authored by me, so someone else ought to approve.

I guess @hjmjohnson does since he merged it previously, but I'll give others a chance before merging in a few days...

@hjmjohnson
hjmjohnson merged commit 0b91c9e into master Oct 6, 2026
4 checks passed
@hjmjohnson
hjmjohnson deleted the clang-tidy-fixes branch October 6, 2026 19:07
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