[cfe-dev] [RFC] automatic variable initialization

Tim Northover via cfe-dev cfe-dev at lists.llvm.org
Thu Nov 15 15:00:32 PST 2018


On Thu, 15 Nov 2018 at 22:53, JF Bastien via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
>   2. Zero initialization
>
>     Zero initialize all values. This has the unfortunate side-effect of
>     providing semantics to otherwise undefined behavior, programs therefore
>     might start to rely on this behavior, and that's sad. However, some
>     programmers believe that pattern initialization is too expensive for them,
>     and data might show that they're right. The only way to make these
>     programmers wrong is to offer zero-initialization as an option, figure out
>     where they are right, and optimize the compiler into submission. Until the
>     compiler provides acceptable performance for all security-minded code, zero
>     initialization is a useful (if blunt) tool.

I disagree with this. I think this is essentially defining a new
dialect of C++, which I have massive concerns about. Additionally, as
much as we might claim it's a transitional measure, we all know that's
not how it'll be used in practice.

Tim.



More information about the cfe-dev mailing list