Re: Another useless warning - 'Hidden Local Variables'
Re: Another useless warning - 'Hidden Local Variables'
- Subject: Re: Another useless warning - 'Hidden Local Variables'
- From: Andy O'Meara <email@hidden>
- Date: Thu, 24 Jul 2008 12:25:37 -0400
On Jul 23, 2008, at 7:11 PM, Chris Jefferson wrote:
2008/7/23 Matt Gough <email@hidden>:
But your example is not what I am complaining about. I want the
warnings
that your example would give.
What I don't want is the ones where the name of a method parameter
matches
the name of a member function.
Remember that method parameters could themselves be functions. Also
you can assign member functions to variables of appropriate type. I
personally would want to be warned about such clashes.
Chris
All fine and agreed upon, Chris, but Matt's main point still stands.
I myself also have also witnessed the pain illustrated in Matt's main
example and recall feeling highly concerned about the inadequacy of
the warning's implementation. Codewarrior, for example, *does* catch
these cases of hidden local vars and that's how we generally spot
them. Unfortunately, however, the ability to "check" compile under CW
becomes increasingly more of a PITA (and I'm guessing the same goes
for you, Sean, iirc). So, the question becomes, is the best plan for
each of us to just submit radars for this one? I know I'm definitely
willing to as long as Apple is the right tree to start barking up.
This reminds me of one of my favorite code humor pieces:
if ( status = NUCLEAR_WAR ) launch_counter_attack();
But I'll adapt it for this topic:
if ( is_war_simulation() ) int status = 0;
if ( status == NUCLEAR_WAR ) launch_counter_attack();
Andy
_______________________________________________
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