Re: Block variable warnings
Re: Block variable warnings
- Subject: Re: Block variable warnings
- From: Jonathan Taylor <email@hidden>
- Date: Wed, 23 Mar 2011 09:08:39 +0000
Because of bugs in clang's C++ support, I'm still using Xcode
3.2.6 to
make ARM builds. When I compile code using blocks, I get a ton of
warnings, e.g. in
b.transform = interimTransform;
[UIView animateWithDuration: kInterimDuration delay: 0.0 options: 0
animations:^ {
b.transform = CGAffineTransformIdentity;
I get
/Users/david/iKoDP/KoDP/Classes/AdviceView.mm:358:0 /Users/david/
iKoDP/
KoDP/Classes/AdviceView.mm:358: warning: declaration of 'b' shadows a
previous local
/Users/david/iKoDP/KoDP/Classes/AdviceView.mm:275:0 /Users/david/
iKoDP/
KoDP/Classes/AdviceView.mm:275: warning: shadowed declaration is here
I don't get these if I use Xcode 4.
How can I suppress these warnings when using Xcode 3.2.x?
#pragma GCC diagnostic ignored "-Wshadow"
...code...
#pragma GCC diagnostic warning "-Wshadow"
I have always been rather wary of this, and have never confirmed to
my satisfaction whether this is simply a spurious warning or an
indication that the compiler has "misunderstood" my source code and
hence potentially generated incorrect code from it (I've reported
this and various similar bugs...). If it crops up I tend to take that
as a cue to simplify what I am doing, and potentially remove that use
of a block entirely, just to be safe...
_______________________________________________
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