Repository navigation
fix: resolve clang-tidy findings for the analysis build - #1144
Merged
Merged
Conversation
andiwand
force-pushed
the
review/125-http-cleanup-logging
branch
from
October 6, 2026 13:27
c29bd7f to
f4f8188
Compare
The tidy job runs clang-tidy 18, which does not keep an optional checked across an iterator dereference, a repeated config() call or a loop with a lambda, and which reports a [[maybe_unused]] string as unused. Check and dereference one named value instead, keep the JPX alpha component as a pointer, and discard the PDF binary-marker line directly. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MxyTMutqSUJRGfxA8CyzMc
andiwand
force-pushed
the
review/126-analysis-policy
branch
from
October 6, 2026 14:04
9ff0b9f to
22862fd
Compare
andiwand
added a commit
that referenced
this pull request
Oct 6, 2026
Since CMake 3.25 the analysis build exports the compilation database and passes it to clang-tidy with -p, so clang-tidy reads the include paths of the configured compiler. The policy file is copied into the build directory, so it also applies to generated sources. This part moved here from #1144, because it changes the block this PR adds. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MxyTMutqSUJRGfxA8CyzMc
andiwand
added a commit
that referenced
this pull request
Oct 6, 2026
Since CMake 3.25 the analysis build exports the compilation database and passes it to clang-tidy with -p, so clang-tidy reads the include paths of the configured compiler. The policy file is copied into the build directory, so it also applies to generated sources. This part moved here from #1144, because it changes the block this PR adds. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MxyTMutqSUJRGfxA8CyzMc
andiwand
added a commit
that referenced
this pull request
Oct 6, 2026
* fix(build): enable clang-tidy before creating targets * fix(build): keep the Conan source export unchanged The Conan recipe never sets ODR_CLANG_TIDY, so a package build never runs clang-tidy and does not need .clang-tidy in its sources. * fix(build): run clang-tidy with the compiler's include paths Since CMake 3.25 the analysis build exports the compilation database and passes it to clang-tidy with -p, so clang-tidy reads the include paths of the configured compiler. The policy file is copied into the build directory, so it also applies to generated sources. This part moved here from #1144, because it changes the block this PR adds. * fix: pass clang-tidy 18 on the Type1 and CID width paths The Type1 fallback glyph is set in the catch, so the catch is not empty. The CID width loop reads its start once inside an explicit check, because clang-tidy 18 does not see that a zero count keeps the loop from the unchecked optional. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
🤖 Generated with Claude Code
Fix the clang-tidy findings that remain once
ODR_CLANG_TIDY=ONruns the analysis (#1134). Exclude the inheritance-shadowing check that conflicts with typed value handles, and narrowly suppress the template-virtual warning for constant error codes. Check paragraph alignment before dereferencing it in the three XML writers and remove a redundant move into PDF decryption.Clang-tidy 18, which the CI tidy job runs, loses track of a checked optional after an iterator dereference, a repeated
config()call or a loop with a lambda, and reports a[[maybe_unused]]string as unused. Check and dereference one named value instead, keep the JPX alpha component as a pointer, and discard the PDF binary-marker line directly.The CMake part that ran clang-tidy through the compilation database moved to #1134, because it changes the block that #1134 adds.
Validation: the full library and CLI analysis build passes with clang-tidy 18 in an Ubuntu 24.04 container that matches the tidy job, and with LLVM 22 clang-tidy. 1072 editing, style, OOXML, ODF, PDF, recalculation and HTML tests pass. Path-sensitive analyzer findings remain advisory under the existing policy.