Repository navigation
outline, textproc: drop locals left unused by earlier refactors - #8
Merged
Merged
Conversation
mcp-cpp builds without warning flags of its own, and hosts that compile it (agentty) pass none, so these never surfaced. Under -Wall -Wextra they are: - outline.cpp:128 and :643, `const auto& re = outline_pattern();` 31ba132 moved matching into outline_line_matches/outline_line_is_def, which call outline_pattern() themselves; the two callers kept a reference they no longer read. outline_pattern() is still used by those helpers. - textproc.cpp:454 (run_extract), `int scanned` 876d0bb replaced the shared atomic total with per-share counts. The summed `scanned` is printed by run_aggregate, but run_extract only needs `capped`, so its sum was written and never read. No behaviour change: the regex is a function-local static either way, and `capped` is computed the same way. Not touched: data.cpp's Step{Kind} initialisers trip -Wmissing-field-initializers, but leaving `key` default-constructed is intended there (the same warning that agentty and maya turn off).
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.
Drop locals left unused by earlier refactors
mcp-cpp's CMake sets no warning flags, and agentty passes none when it
builds mcp-cpp, so agentty's build log stays quiet about this repo. Checking
every mcp-cpp file with
-Wall -Wextraturned up three dead locals:src/tools/outline.cpp:128and:643,const auto& re = outline_pattern();.31ba132 moved matching into
outline_line_matches/outline_line_is_def,which call
outline_pattern()themselves.src/tools/textproc.cpp:454(run_extract),int scanned. Since 876d0bbit is summed but never read.
run_aggregatedoes print its ownscanned,and that one is unchanged.
None of this changes behaviour.
Worth considering
Should mcp-cpp's own targets get
-Wall -Wextra(with-Wno-missing-field-initializers, as agentty and maya do), so the nextdead local shows up on its own?
Left alone
src/tools/data.cpp80-83, 119, 138:Step{Kind}trips-Wmissing-field-initializers. Leavingkeydefault-constructed is theintent there. agentty and maya both turn this warning off.
Verification
g++ -fsyntax-only -Wall -Wextrawith agentty's flags:outline.cppandtextproc.cppgive no warnings.