[PATCH] D74361: [Clang] Uninitialize attribute on global variables

JF Bastien via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 18 09:30:48 PST 2020


jfb added a comment.

In D74361#1879559 <https://reviews.llvm.org/D74361#1879559>, @rjmccall wrote:

> I'm not sure if it's a good idea to be re-using the existing attribute like this.  It's not that unreasonable, I guess, but I'd like to hear JF's thoughts.


The current uninitialized attribute fits the model C and C++ follow for attributes: they have no semantic meaning for a valid program, in that a compiler can just ignore them and (barring undefined behavior) there's no observable effect to the program. This updated semantic changes the behavior of a valid C and C++ program, because the standards specify the value of uninitialized globals and TLS. I'd much rather have a separate attribute, say `no_zero_init`, to explicitly say what this does.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74361





More information about the cfe-commits mailing list