Add initial Clang-Tidy baseline - #13602
Open
bneradt wants to merge 7 commits into
Open
Conversation
Clang-Tidy can catch focused correctness problems that the existing Clang Static Analyzer does not cover. An explicit check list also keeps toolchain upgrades from changing the policy unexpectedly. This patch adds the initial CI configuration and fixes its realloc, move-lifetime, argument-order, and vector-capacity findings.
added 3 commits
August 28, 2026 13:56
Incorrect sizeof expressions can silently compute the size of a pointer instead of its pointee. The current source tree has no such diagnostics. This patch enables the focused Clang-Tidy check so CI rejects future instances.
Views that outlive their backing storage can introduce subtle use-after-free bugs. Clang-Tidy could not prove that the temporary ATS view did not own the outbound SNI storage. This patch returns the SNI through std::string_view directly and enables the dangling-handle check for future lifetime mistakes.
MgmtByte is a signed byte, so implicit integer promotion can sign-extend configuration values. The affected settings accept only nonnegative values, but their conversions did not make that constraint clear. This patch preserves the byte type where an integer is unnecessary, converts the in/out policy through an unsigned byte, and enables the Clang-Tidy check.
added 2 commits
August 28, 2026 14:26
Developers using the repository Clang-Tidy configuration did not see most diagnostics enforced by CI, so failures could first appear after a change was pushed. This patch makes the local configuration a superset of the CI policy while preserving its additional advisory checks.
Single-character searches using string-literal overloads perform more work than their character-overload equivalents. Five existing searches used the more general forms. This patch uses the character overloads and enables the focused Clang-Tidy check so new instances fail CI.
cmcfarlen
previously approved these changes
Aug 28, 2026
On targets where plain char is signed, high-bit cookie names can index before the validation table. Other bounded byte conversions also trigger the new CI check. This patch makes byte signedness explicit for lookup indexes and other byte-oriented state while preserving the parser helpers' char interface.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clang-Tidy can catch focused correctness problems that the existing
Clang Static Analyzer does not cover. An explicit check list also keeps
toolchain upgrades from changing the policy unexpectedly.
This patch adds the initial CI configuration and fixes its realloc,
move-lifetime, argument-order, and vector-capacity findings.