Skip to content

Fix GCC 14.3.0 compilation error in shader_utils.cpp#17

Closed
Copilot wants to merge 3 commits intoflake_fixfrom
copilot/sub-pr-7-one-more-time
Closed

Fix GCC 14.3.0 compilation error in shader_utils.cpp#17
Copilot wants to merge 3 commits intoflake_fixfrom
copilot/sub-pr-7-one-more-time

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 16, 2025

GCC 14.3.0's improved static analysis flags potential null pointer dereferences in std::istreambuf_iterator usage with -Werror, causing build failures in the Nix flake CI workflow.

Changes

  • Replace std::istreambuf_iterator with std::stringstream in readShaderSource()
    • Avoids false positive null-dereference warnings from GCC 14.3.0
    • Maintains identical functionality with cleaner, more idiomatic code
// Before: Triggers GCC 14.3.0 warning
return std::string((std::istreambuf_iterator<char>(file)),
                   std::istreambuf_iterator<char>());

// After: Standard idiom, no warnings
std::stringstream buffer;
buffer << file.rdbuf();
return buffer.str();

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…reambuf_iterator

Co-authored-by: jamylak <1940205+jamylak@users.noreply.github.com>
@jamylak
Copy link
Copy Markdown
Owner

jamylak commented Dec 16, 2025

@copilot I didn't want you to switch to stringstream, i wanted you to leave it as it was before, but make sure the flake is using CPP 20

Co-authored-by: jamylak <1940205+jamylak@users.noreply.github.com>
Copilot AI changed the title [WIP] Add test case for flake functionality Fix GCC 14.3.0 compilation error in shader_utils.cpp Dec 16, 2025
Copilot AI requested a review from jamylak December 16, 2025 10:11
@jamylak jamylak closed this Dec 16, 2025
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