• 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
Techniques to suppress "unused member variable" Clang warnings?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Techniques to suppress "unused member variable" Clang warnings?


  • Subject: Techniques to suppress "unused member variable" Clang warnings?
  • From: James Bucanek <email@hidden>
  • Date: Thu, 3 Feb 2011 15:46:36 -0700

Greetings,

I'm dusting off a couple of large projects, cleaning warnings, and running the static analyzer on them.

There are a few erroneous warnings that Clang can't seem to deal with. I have one that occurs again and again, and I'd like to suppress them but can't figure out how.

"Instance variable 'someVariable' in class 'SomeClass' is never used by the
methods in its @implementation (although it may be used by category methods)"


And that's exactly the case. I have numerous instance variables which are only used by categories.

This is most common warning that I can't get rid of. In other places where Clang can't make sense of things, I can comment out the code with #if __clang_analyzer__ / #endif, so the code isn't seen by the analyzer. But in this case, commenting out these variables just creates a bunch of undefined variable errors. And the GCC #pragma unused() doesn't apply to instance variables.


_______________________________________________ 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: Techniques to suppress "unused member variable" Clang warnings?
      • From: Hamish Allan <email@hidden>
    • Re: Techniques to suppress "unused member variable" Clang warnings?
      • From: "Sean McBride" <email@hidden>
    • Re: Techniques to suppress "unused member variable" Clang warnings?
      • From: Jim Thomason <email@hidden>
    • Re: Techniques to suppress "unused member variable" Clang warnings?
      • From: James Bucanek <email@hidden>
  • Prev by Date: Re: debugging EXC_BAD_ACCESS
  • Next by Date: Re: Techniques to suppress "unused member variable" Clang warnings?
  • Previous by thread: Re: Possibility to change preferences for auto-[]
  • Next by thread: Re: Techniques to suppress "unused member variable" Clang warnings?
  • Index(es):
    • Date
    • Thread