public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* warning that warns about iso compliant code
@ 2008-04-30 15:14 Burlen Loring
  0 siblings, 0 replies; only message in thread
From: Burlen Loring @ 2008-04-30 15:14 UTC (permalink / raw)
  To: gcc-bugs


Hi all, this is more of a complaint/feature request

for code such as:

int main()
{
int nToProcess=0;
for (int i=0; i<nToProcess; ++i)
{
int nComp=0;
for (int i=0; i<nComp; ++i)
{
int j=i;
}
int q=i;
}
return 0;
}


I have the following warnings:

testNetsted.cpp: In function ‘int main()’:
testNetsted.cpp:11: warning: name lookup of ‘i’ changed
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... It would be nice if the compiler warned about the 
case that didn't follow the standard. Or am I just being silly and I 
should use different index variable name for all of my nested loops, 
even when the don't depend on each other...

Thanks Burlen



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-30 15:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-30 15:14 warning that warns about iso compliant code Burlen Loring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).