1

How can I suppress the "dead store" warning on a single file in Xcode?

I tried

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-value"

without luck. Any suggestions?

BTW, I don't want to "fix" the code, because I'm creating a bunch of objects only for the sake of inserting them into a Core Data database. I don't want to do anything else with them at the moment.

cfischer
  • 24,452
  • 37
  • 131
  • 214
  • just tell me, what is the "dead store"? – MasterRazer Aug 25 '13 at 21:09
  • 2
    Why are you trying to suppress a dead store warning? Why not just fix it? – Mick MacCallum Aug 25 '13 at 21:26
  • @0x7fffffff I'm creating a bunch of object only for the sake of inserting them into a Core Data database. I don't want to do anything else with them at the moment. – cfischer Aug 25 '13 at 21:44
  • 1
    The second answer here should help: http://stackoverflow.com/questions/5294761/how-to-mask-an-unwanted-dead-store-warning-in-xcode – atomkirk Aug 25 '13 at 22:18
  • 1
    @atomk: “Second” is relative to sort order. You may want to post an answer here that quotes and links to the specific answer you're referring to. – Peter Hosey Aug 25 '13 at 23:51

1 Answers1

1

Although it doesn't work for the whole file, you can silence individual warnings for dead stores by adding

(void)variable;

after the line causing the warning