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: Jens Alfke <email@hidden>
- Date: Fri, 13 Nov 2009 15:20:18 -0800
This is why I never turn on that warning — due to namespace pollution by the standard C library and POSIX APIs, too many common variable names happen to shadow some function like 'index' or 'time' or 'open'.
I don't agree with Peter Hosey's position in that blog post. I posted this as a comment: "I disagree. If you can pass a pointer as an array index and not get a compile error, something's dangerously wrong with your build process. This is why I ALWAYS, ALWAYS build with -Werror ("Treat warnings as errors".) There are too many things GCC treats as warnings that are very dangerous and should be fixed immediately. This goes double for Obj-C programming, where things like misspelled selectors only generate warnings."
—Jens |
_______________________________________________
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