Repository navigation
Conversation
…-set-global) tests/test_wayland_libdecor_hint.py compiles host/posix/display_sdl.c's hos_display_init with authored stubs under -Wall -Wextra -Werror. The fixture declares the sdl_ready global the function sets, but never read it, and Clang 23 (the readme's LLVM 23, and tests/run_all.py takes clang++ before g++) adds -Wunused-but-set-global to -Wall: "harness.cpp:25:12: error: variable 'sdl_ready' set but not used". The check failed before it ran a case. The harness now prints sdl_ready beside the init result, as the real file reads it in hos_display_owns_sdl. Builds and passes with Clang 23.1.3 and GCC 16.2.1. Assisted-by: Claude Opus 5.5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Rebased onto main |
5764c81 to
ecfe42a
Compare
Joey-Magnus
left a comment
There was a problem hiding this comment.
Thanks for tracking this down with a real Clang 23 run. The diagnosis was right, but main already fixed the same warning a different way, so this PR is no longer needed.
question tests/test_wayland_libdecor_hint.py:42: #2171 (b5d6793, merged 2026-11-11 11:57) added int hos_display_owns_sdl(void) { return sdl_ready; } to the harness. Its commit message says "a one-line display-fixture declaration fixes an upstream Clang 23 unused-state warning". The global now has a reader, so -Wunused-but-set-global no longer fires on main. Your test run was on 49f75dc, which predates #2171. The rebase onto b29967b picked #2171 up without a conflict, which is why the diff still looks valid. On the current head, the extra sdl_ready in the printf (line 51) is a second read of a global that is already used, and the comment beside it gives a reason that no longer applies. Could you confirm with your Clang 23 that main passes without this change? If it does, I'd close this as superseded by #2171 (and maybe note that on #2334).
The two red CI jobs have nothing to do with this change. Windows part 1/2 fails in tests/test_native_astc_texture_count.py, and the appimage job timed out on a network download while installing system packages.
Joey-Magnus
left a comment
There was a problem hiding this comment.
I think #2171 already covers this: main's tests/test_wayland_libdecor_hint.py:42 has int hos_display_owns_sdl(void) { return sdl_ready; }, so the global already has a reader. This would add a redundant one, so it can probably be closed.
|
Confirmed on clean main |
tests/test_wayland_libdecor_hint.pyfails before it runs a case with Clang 23 (the readme: "LLVM 23 or newer readsthe play profile";
tests/run_all.pytakesclang++beforeg++): its C++ fixture is built with-Werror, andClang 23's
-Wallnow includes-Wunused-but-set-global.Part of #2334.
What changed
sdl_readyglobal that the function under test (hos_display_initfromhost/posix/display_sdl.c) sets, but never read it. The warning is right about the fixture: in the real filehos_display_owns_sdlreads it. The harness now prints it beside the init result (sdl2: init 1, ready 1,headless: init 0, ready 0). No warning is switched off.How it was tested
Linux (Arch):
-Wunused-but-set-globalcomes with-Wallin Clang 23 (a three-line file whose global is only written: warned with-Wall, not with-Wextraalone).python -I -B tests/run_all.pyon main 49f75dc with this change (2026-11-11, Clang 23 asclang++, load about 70to 140): 362 passed, 2 failed, 10 skipped;
tests/test_wayland_libdecor_hint.pypasses.tests/test_updater_asset_digest.pyfails on main as well on this machine (only a .NET 10 SDK; a pull request of its own).
tests/test_bake_skeleton.pyfailed when one of its compiler processes ended with no output under that load; run alone afterwards it passes (9
tests, 110 s).
Not tested
RUN_ALL_SKIP), as before.Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com