Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with union initialization using braces #2033

Open
nathanchance opened this issue Jun 26, 2024 · 1 comment
Open

Issue with union initialization using braces #2033

nathanchance opened this issue Jun 26, 2024 · 1 comment
Labels
[BUG] llvm A bug that should be fixed in upstream LLVM [PATCH] Submitted A patch has been submitted for review Reported upstream This bug was filed on LLVM’s issue tracker, Phabricator, or the kernel mailing list.

Comments

@nathanchance
Copy link
Member

A recent thread reveals that a union where the first member is not the largest member may not be initialized fully with either {} or { 0 }, which Linus considers a bug for the kernel. It sounds like there is not much opposition for default initializing the first member and zero initializing the rest of the union from some discussion on the upstream LLVM tracker.

@nathanchance nathanchance added [BUG] llvm A bug that should be fixed in upstream LLVM Reported upstream This bug was filed on LLVM’s issue tracker, Phabricator, or the kernel mailing list. labels Jun 26, 2024
@nathanchance
Copy link
Member Author

I think llvm/llvm-project#97121 is the proposed upstream fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[BUG] llvm A bug that should be fixed in upstream LLVM [PATCH] Submitted A patch has been submitted for review Reported upstream This bug was filed on LLVM’s issue tracker, Phabricator, or the kernel mailing list.
Projects
None yet
Development

No branches or pull requests

1 participant