Repository navigation
frontend: Fix the macOS build: copy QJsonArray elements in the GPU status loops - #1035
Merged
Merged
Conversation
zackees
enabled auto-merge
October 16, 2026 07:53
auto-merge was automatically disabled
October 16, 2026 08:19
Pull request was closed
zackees
force-pushed
the
fix/gpu-status-range-loop
branch
from
October 16, 2026 08:20
b884c55 to
bfb32fa
Compare
zackees
enabled auto-merge
October 16, 2026 08:20
QJsonArray's iterator yields QJsonValue by value, so 'const QJsonValue &' loop variables bind to temporaries; Apple clang builds with -Werror,-Wrange-loop-bind-reference and the macOS build fails (GpuStatus.cpp:36, :56, :59; run 38867987465). Linux GCC does not warn. Reproduced and verified locally with clang -Werror.
zackees
force-pushed
the
fix/gpu-status-range-loop
branch
from
October 16, 2026 08:27
bfb32fa to
cf8f2de
Compare
Member
Author
|
Rebased on master. PR runs no longer include full app builds (AGENTS.md: "the full OBS app builds never run from a PR path"), so the macOS evidence here is the local clang reproduction: same three errors before, clean after with |
This was referenced Oct 16, 2026
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.
master's macOS build is broken.
frontend/utility/GpuStatus.cpp(from #960, #963 and #1006) loops overQJsonArraywithconst QJsonValue &. The iterator returnsQJsonValueby value, so Apple clang's-Werror,-Wrange-loop-bind-referencefails the build:This is from the macOS arm64 job of release verify run 38867987465. Linux GCC does not have this warning, which is why my GCC syntax checks missed it.
Fix:
const QJsonValue x(by value). There is no extra copy; the value is a temporary either way.RED → GREEN, locally with clang:
clang++ -fsyntax-only -Werror=range-loop-bind-referencegives the same three errors on master.-Wall -Wextra -Werror -Wrange-loop-bind-reference -Wrange-loop-construct,GpuStatus.cppis clean. No otherfor (const QJsonValue &exists infrontend/orshared/.ci-fullruns the macOS builds. Please merge this ahead of the daily release.