Skip to content

linux/apply, windows/compile: rename locals that shadow (-Wshadow) - #5

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

Rename two locals that trip -Wshadow

claybin builds with -Wshadow, and agentty's dev build showed two warnings
from it. Both are renames only.

  • src/linux/apply.cpp: the netns-inode parse loop declared
    const char* p, which hid the callback's Phase p. Renamed to d, the
    digit cursor.
  • src/windows/compile.cpp: native_path's std::string out hid
    compile()'s Compiled out. Renamed to native, which is what the string
    holds.

Neither was a bug: the loop never reads the phase, and native_path
captures nothing. Renaming keeps a later edit from reaching the wrong
variable, and makes the -Wshadow build quiet again.

Base

This is cut from this repo's master (2843bbc). agentty currently pins
claybin at a4f876b, four commits earlier. Both lines are the same at both
commits.

Verification

  • g++ -fsyntax-only -Wall -Wextra -Wshadow with agentty's flags for these
    files: no warnings.
  • builds and ctests are clean and 100% PASS. The Windows file was only syntax-checked
    on Linux, through its normal compile path.

claybin builds with -Wshadow, and two locals tripped it:

- linux/apply.cpp: the netns-inode parse loop declared `const char* p`
  inside the for_each callback, which already has `Phase p` for the
  op's phase. The loop never needed the phase, but a later edit in that
  case block reading `p` would get whichever was closest. Renamed to `d`
  (digit cursor).

- windows/compile.cpp: native_path's `std::string out` shadowed
  compile()'s `Compiled out`. native_path captures nothing ([]), so it
  could not touch the outer one, but the shared name made the two easy
  to mix up when reading compile(). Renamed to `native`, which is what
  the string holds.

Names only, no behaviour change. -fsyntax-only with -Wall -Wextra
-Wshadow is clean for both TUs.
@1ay1
1ay1 merged commit 19a6c27 into agentty-org:master Nov 15, 2026
6 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