Skip to content

outline, textproc: drop locals left unused by earlier refactors - #8

Merged
1ay1 merged 1 commit into
agentty-org:masterfrom
sail3r:fix/build-warnings
Nov 15, 2026
Merged

1ay1 merged 1 commit into
agentty-org:masterfrom
sail3r:fix/build-warnings

Conversation

@sail3r

@sail3r sail3r commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

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 -Wextra turned up three dead locals:

  • src/tools/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.
  • src/tools/textproc.cpp:454 (run_extract), int scanned. Since 876d0bb
    it is summed but never read. run_aggregate does print its own scanned,
    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 next
dead local shows up on its own?

Left alone

  • src/tools/data.cpp 80-83, 119, 138: Step{Kind} trips
    -Wmissing-field-initializers. Leaving key default-constructed is the
    intent there. agentty and maya both turn this warning off.

Verification

  • g++ -fsyntax-only -Wall -Wextra with agentty's flags: outline.cpp and
    textproc.cpp give no warnings.
  • build and ctests are warning free and pass 100%.

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).
@1ay1
1ay1 merged commit 7e6242c into agentty-org:master Nov 15, 2026
2 checks passed
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