Skip to content

fix: warnings in maya build - #11

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

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

Conversation

@sail3r

@sail3r sail3r commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Fix the two warnings in maya's build

test(style): close the frame in the double-buffer theme test

tests/test_style.cpp:687 and :703 stopped the render pipeline at
write_diff() and threw away its result. write_diff() is [[nodiscard]]
because that result is the still-open frame, so GCC warned
-Wunused-result. Each chain now ends with close_frame(false), the same
call render_fullscreen.cpp makes. The only bytes this adds are the
\x1b[0m reset, so the test's three asserts check exactly what they checked
before.

input: keep a backslash off the end of a // comment

src/terminal/input.cpp:235 ended a // comment with ESC \. The compiler
joins a line ending in \ to the next one before it looks at comments,
which is what GCC warns about with -Wcomment, and the warning shows up in
every host build. The next line was also a comment, so nothing was lost
today. But if that line ever became code, it would be silently commented
out.

The fix rewraps the sentence so ESC \ sits in the middle of a line. The
wording does not change.

This is the only // comment in maya that ends in a backslash. I grepped
for the pattern.

Verification

  • g++ -fsyntax-only with the flags from maya's own build/compile_commands.json
    for tests/test_style.cpp: no warnings.
  • g++ -fsyntax-only -Wall -Wextra with agentty's flags for
    src/terminal/input.cpp:
    the -Wcomment warning is gone. The one warning left
    (-Wmissing-field-initializers at line 255) is turned off by maya's own
    CMake flags.
  • build and ctests are clean with no warnings, all tests pass 100% (host_pty_test skipped, no python deps needed here).

A // comment whose last character is '\' is joined to the next line by
line splicing (translation phase 2), before comments are recognised, and
GCC reports -Wcomment. The joined line here was itself a comment, so no
code was lost, but the warning showed up in every host build that
compiles maya with its default flags, and any later edit that turned the
next line into code would have silently commented it out.

Rewrap the sentence so "ESC \" sits mid-line. Wording is unchanged.
"theme: a swap survives the fullscreen double-buffer too" ran the
pipeline up to write_diff() and dropped the result. write_diff() is
[[nodiscard]] because the Opened stage it returns is the frame that is
still open, so GCC warned -Wunused-result at both call sites (lines 687
and 703), the only warnings in maya's own build.

Finish each chain with close_frame(false), the same call
render_fullscreen.cpp makes. sync_output=false matches open_frame(false),
so the only bytes added are the SGR reset "\x1b[0m". It contains neither
background SGR the test looks for, so all three asserts check what they
checked before: the first frame has the old background, the second has
the new one and not the old.

-fsyntax-only with maya's own compile_commands flags: no warnings.
@1ay1
1ay1 merged commit 9f73138 into agentty-org:master Nov 15, 2026
10 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