Re: warning: local declaration hides instance variable
Re: warning: local declaration hides instance variable
- Subject: Re: warning: local declaration hides instance variable
- From: Tron Thomas <email@hidden>
- Date: Mon, 03 Sep 2007 11:10:42 -0700
Shawn Erickson wrote:
On Sep 3, 2007, at 10:33 AM, Tron Thomas wrote:
If I do something equivalent in C++ like:
class Value
{
private:
int value;
public:
void SetValue(int value)
{
this->value = value;
};
};
I don't get any warnings. What is the reason for the warning in
Objective-C and no warning in C++?
Objective-C is a superset of C not C++ ;-)
Likely the compiler is simply not bothering to check if uses of the
lvar really do hide the ivar. File a defect if you want [1] but in
general you don't normally see much objective-c code accessing ivars
via struct references. In other words it is a case that isn't seen much
so their may not be much interest in changing it.
-Shawn
[1] <http://developer.apple.com/bugreporter/>
It seems that java also doesn't emit a warning under
similar circumstances.
|
_______________________________________________
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