Atwood, Robert C wrote:
-----Original Message-----
On Behalf Of Burlen Loring
Sent: 01 May 2008 14:22
...
testNetsted.cpp:4: warning: matches this 'i' under ISO standard rules
testNetsted.cpp:7: warning: matches this 'i' under old rules
To me it seems the compiler should not warn about code that
follows the
ISO standard rules. However, it would be nice if the compiler warned
about the case that didn't follow the standard.
I don't see how the compiler could know when someone intended to use the
old rules? So how could it know which 'case' this example is?
Until someone implements the DWIM directive ;-0.
So though I did not even know about the 'old rules' I would agree with
Scott (me22) that as long as someone might have learned the old rules,
and come back from not programming c++ for a while, a warning for this
is not a bad idea.
I also would have been told by my teachers that this is poor and
errorprone style, opinions may differ, I don't even like declaring loop
variables inside the for() .. Because I use c mostly ..
Try telling your customers about their poor errorprone style.