Re: delete vs delete[]
"Ben Voigt" wrote:
It is much more appropriate for tools like lint or team
system's /analyze to detect stuff like this, definitely!
Why? The only reason I can see (not an invalid one to be
sure) is so MS and others can make money charging extra
for the advanced analysis. Certainly most warnings now
emitted by the compiler were once the responsibility of
lint. I don't think anyone would now argue having them in
lint is "much more appropriate".
Another reason is limited development resources. MS compiler
is already one of the most feature loaded compiler on the
market. It supports native C++, managed C++ bastard,
CLI/C++, a bunch of MS specific features (COM compiler
suppoert, for example) etc. etc. With all that it has good
optimizer, greatly improved templates support and
diagnostics and good standard compliance. In VS2005 Team
System suite compiler has lint-like analysis features, as
well. So, you need to draw a line somewhere. You can't have
it all.
I'd like to see lint analysis tool part of VC++ package,
however I'm not sure it should be part of the compiler. Lint
attempts to analyze source code in order to find potential
run-time problems. It is logical to separate this feature
from syntactical check, which compiler performs. It is the
same separation as compiler/linker separation, for instance.
Alex