• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Variable "shadowing"?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Variable "shadowing"?


  • Subject: Re: Variable "shadowing"?
  • From: Giovannini <email@hidden>
  • Date: Fri, 18 Mar 2005 18:15:39 -0600

Variable shadowing is when two variables legally have the same name in the same context. One variable hides/shadows the other. It is legal to have a function parameter with the same name as a global or member variable. The parameter is closer to the current context so it has precedence. Rename your parameter.

On Mar 18, 2005, at 1:38 PM, Mark Dawson wrote:

What does it mean to turn on variable shadowing?

I'm getting errors like:

declaration of "index" shadows a global implementation
- (void)insertGraphic:(Draw2D_BaseGraphic *)graphic atIndex:(unsigned)index
<x-tad-smaller>
/usr/include/string.h:107: warning: shadowed declaration is here
</x-tad-smaller>
char *index(const char *, int);
_______________________________________________
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

References: 
 >Variable "shadowing"? (From: Mark Dawson <email@hidden>)

  • Prev by Date: Fwd: Include directory confusion in XCode
  • Next by Date: Debugger confused about line numbers
  • Previous by thread: Re: Variable "shadowing"?
  • Next by thread: DevTools version
  • Index(es):
    • Date
    • Thread