Repository navigation
widget: fix -Wmaybe-uninitialized error in scroll_bar with GCC 16 - #198
Merged
Merged
Conversation
GCC 16 raises a false-positive -Wmaybe-uninitialized in the scroll_bar constructor: it cannot track values initialized before the use across base class constructor calls. Move the default resource loading into the constructor body and suppress the warning for GCC 16.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #198 +/- ##
==========================================
+ Coverage 28.53% 28.55% +0.02%
==========================================
Files 239 239
Lines 8943 8943
Branches 2785 2785
==========================================
+ Hits 2552 2554 +2
+ Misses 6057 6055 -2
Partials 334 334 ☔ View full report in Codecov by Harness. |
igagis
reviewed
Nov 26, 2026
igagis
reviewed
Nov 26, 2026
igagis
reviewed
Nov 26, 2026
Use '#'+tab before the pragma directive, as required by the project's clang-format configuration.
igagis
reviewed
Nov 27, 2026
- rename 'c' parameter to 'context' - use this->context style in the initializer list and constructor body
…r rename The earlier PR commits suppressed -Wmaybe-uninitialized via a GCC-only pragma, moved default resource loading into the constructor body, and changed the initializer list to use this->context. This reverts all of that, keeping only the c -> context rename, which itself suppresses the warning.
igagis
approved these changes
Nov 30, 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.
GCC 16 raises a false-positive
-Wmaybe-uninitializedin thescroll_barconstructor (it cannot track values initialized before the use across base class constructor calls), breaking the build with-Werror.Fix by renaming the
cconstructor parameter tocontext. Barecontextin the remaining initializers then refers to the parameter (a plain function argument that GCC can track), so the warning disappears.Note:
contextin the initializer list and the default resource loader lambda refers to the parameter, not the stored memberthis->context(which is a copy of the argument initialized by the virtual base constructor) — the two are the same shared_ref, so behavior is unchanged.Verified with a full build and the complete test suite (353 ruis tests pass).