Re: self-confidence of compiler



Peter Duniho wrote:
On Tue, 08 May 2007 15:06:16 -0700, Jon Skeet [C# MVP] <skeet@xxxxxxxxx> wrote:

Out of interest (and not in any way trying to sound snide) do you know
of any languages/compilers which prevent access to possibly-unassigned
variables in this kind of way? I'm pretty sure Java's rules are similar
to C#'s. I don't recall it being part of the C/C++ spec at all,
although I'm much less familiar with those.

No...honestly I never really paid much attention to the issue until now. And I don't think you sounded snide...it's a perfectly reasonable question.

I do know that I don't recall my C++ code generating "this variable is unassigned" errors, but that's probably due to the lack of *any* checking as opposed to more correct checking.

VC++ also has some basic checking. But in the case of the sample of valentin t. the C++ compiler simply doesn't warn anymore.
That doesn't mean that the C++ is much better in detection, but simply turns of the warning if it can't detect the usage of uninitialized variables anymore.


> [...]
Pete
.


Loading