On Tuesday, 6 November 2018 at 01:05:04 UTC, Neia Neutuladh wrote:
In C++, if you skip over `int i = 10;` it's an error, but not if you skip over `int i;`.

In fact I agree with that rule more than the D one to be honest. Since It isn't initialized and never used, I think a warning should be enough instead of an error.

On the other hand, if there is a possibility that the variable can be accessed, then an error should be throw.

Like:

{
   goto Q:
   int x;
   Q:
   x = 10; // An error is ok.
}

But here:

{
   goto Q:
   int x; // An warning should be enough in my IMHO.
   Q:
   return;
}

MatheusBN.

Reply via email to