Re: Stupid "warning: declaration of 'index' shadows a global declaration"
Re: Stupid "warning: declaration of 'index' shadows a global declaration"
- Subject: Re: Stupid "warning: declaration of 'index' shadows a global declaration"
- From: Paul M <email@hidden>
- Date: Mon, 16 Nov 2009 11:02:03 +1300
One reason I never use 'i' as a variable name. Trying to search your
code for 'i'
to debug variable usage is pretty frustrating.
paulm
On 16/11/2009, at 6:00 AM, Steve Mills wrote:
On Nov 15, 2009, at 09:40:44, Clark Cox wrote:
I have never encountered a situation where this warning is generated
that doesn't also generate another error or warning. Any problems in
your code that it shows are *already* shown to you by the other
messages.
What other warning or error is going to show you that you've just
redeclared i in this example?
void blah(void)
{
for(long i = 0; i < 10; i++) {
Now put a couple of pages of code between here...
...and here, making it difficult to know what i already exists.
for(long i = 0; i < 20; i++)
printf("%ld\n", i);
}
}
Steve Mills
Drummer, Mac geek
http://sjmills5.home.mchsi.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden