Docs: Section on local variables
Andrej Mitrovic
andrej.mitrovich at gmail.com
Fri Apr 20 19:50:21 PDT 2012
On 4/21/12, Jakob Ovrum <jakobovrum at gmail.com> wrote:
> If a simple, unconditional
> default-initialization was an objectively superior solution,
> nobody would bother implementing control flow graphs.
If x then y.
If warnings were superior then nobody would write shit like this:
#pragma(push)
#pragma warning(disable: 4701)
int x;
#pragma(pop)
Or even better when someone furiously adds a comment:
....
int x = 0; // silence stupid gcc warning #@!*&%
x = ...
I've seen both of these used in popular C++ codebases.
So, ultimately we can rely on .init in D, and we already do. If
someone missed warnings in D for locals initialized to .init then how
come nobody ever complains about them?
More information about the Digitalmars-d
mailing list