Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable the "local declaration of 'foo' hides instance variable" warning?

Tags:

xcode

llvm

I understand what the warning says. This is exactly how scoping rules work. I appreciate that some people want a nanny. I don't. How can I disable this warning?

like image 889
iter Avatar asked Jun 10 '11 19:06

iter


2 Answers

You can't disable this warning in the current version of XCode. There is no build setting for it, nor does it have a warning ID which you could use to pass a flag to the compiler to tell it to quit whining.

For future reference, you can find that warning ID by going to the Log Navigator, clicking on the most recent build where the warning appeared, drilling down into the log to find the point where the 'compile' task shows up with an exclamation mark and click the 'more detail' button, which looks like a gray callout with 5 horizontal lines. You'll see the warnings/errors listed in detail, and if there was a warning ID it would appear on the line detailing the warning in yellow. At least, thats what I've been told by one of the Compiler Engineers at Apple. I have yet to see a warning that I actually want to disable have an ID appear in the log.

File a bugreport with Apple, tell them you want more options to disable warnings in XCode and list this one specifically.

like image 142
RyanR Avatar answered Oct 19 '22 09:10

RyanR


In Xcode 4.4 this can be disabled by going to the build setting "Other Warning Flags" and setting the value "-Wno-shadow-ivar"

like image 30
Andrew Raphael Avatar answered Oct 19 '22 08:10

Andrew Raphael