Repository navigation
Fix GCC SmallVector growth uninitialized warning - #53
Merged
Merged
Conversation
cyyever
marked this pull request as ready for review
November 17, 2026 03:53
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.
Linked issue or supporting maintainer
Requested by the BakeLab maintainer to repair the Gitea CUDA wheel build.
BC-breaking?
No.
Agent details (AI-generated)
Gitea CUDA wheel run 8608 fails under GCC 16 at
SmallVector.h:150: constructing or resizing an empty SmallVector passes the address of uninitialized inline storage to the out-of-linegrow_podhelper. GCC assumes its const pointer parameter may read that storage.Annotate the address-only FirstEl parameter with GCC's
access(none, 2)(parameter 1 is the implicitthis). The implementation only compares FirstEl with BeginX; live elements are copied through BeginX using the initialized size. This preserves the ABI and allocation behavior, avoids zeroing unused inline capacity, and keeps-Werror=maybe-uninitializedenabled. Clang and older GCC builds do not receive the attribute.Validation: a standalone reproducer using this header for both sized construction and resize fails before the fix with GCC 16
-O3 -Werror=maybe-uninitializedand compiles after it. The same reproducer compiles with Clang and-Werror.git diff --checkpasses. Full CUDA compilation and lintrunner were not run locally (lintrunner unavailable); remote CD must validate the full build.