[PATCH] D68115: Zero initialize padding in unions

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 14 13:38:17 PST 2020


aaron.ballman added a comment.

In D68115#1820462 <https://reviews.llvm.org/D68115#1820462>, @vitalybuka wrote:

> I would be happy to finish this patch if we agree on something.
>
> So if I understand this the proposal is to have something like -fzero-union-padding which is off by default.
>  When it's OFF compiler will continue to do whatever it does now.
>  When it's ON it will set zeroes into padding with or without -ftrivial-auto-var-init.
>  Is this correct?


In general, I believe so, yes. To be clear, it only sets zeros into union padding, not *all* padding. I do not have an opinion on whether we want it to be `-fzero-union-padding` as opposed to `-finit-union-padding` that honors the pattern from `-ftrivial-auto-init=pattern` and defaults to zero if no pattern is specified.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68115/new/

https://reviews.llvm.org/D68115





More information about the cfe-commits mailing list