• 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: Stupid "warning: declaration of 'index' shadows a global declaration"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stupid "warning: declaration of 'index' shadows a global declaration"


  • Subject: Re: Stupid "warning: declaration of 'index' shadows a global declaration"
  • From: Keary Suska <email@hidden>
  • Date: Sun, 15 Nov 2009 09:30:12 -0700

On Nov 15, 2009, at 8:40 AM, Clark Cox wrote:

> On Sat, Nov 14, 2009 at 9:30 PM, Steve Mills <email@hidden> wrote:
>> On Nov 14, 2009, at 14:09:54, Jens Alfke wrote:
>>
>>> 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 still insist on using it because it *does* show problems in your own code,
>
> 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.
>
>> and it *can* be a valid warning that shows you possible real logic errors. But yeah, it does get
>> annoying when building other people's code, like there are tons of them in boost and/or gil.

I would add that what I think is "stupid" is the warning being flagged when a variable declaration masks a function declaration. If it were just variable shadowing I would heartily support it. Not only is the warning immediately misleading, but what coder in her right mind would make a function call without parentheses?

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

 _______________________________________________
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

  • Follow-Ups:
    • Re: Stupid "warning: declaration of 'index' shadows a global declaration"
      • From: David Hayes <email@hidden>
References: 
 >Re: Stupid "warning: declaration of 'index' shadows a global declaration" (From: Steve Mills <email@hidden>)
 >Re: Stupid "warning: declaration of 'index' shadows a global declaration" (From: Clark Cox <email@hidden>)

  • Prev by Date: Re: Stupid "warning: declaration of 'index' shadows a global declaration"
  • Next by Date: Re: Stupid "warning: declaration of 'index' shadows a global declaration"
  • Previous by thread: Re: Stupid "warning: declaration of 'index' shadows a global declaration"
  • Next by thread: Re: Stupid "warning: declaration of 'index' shadows a global declaration"
  • Index(es):
    • Date
    • Thread