3

There is some 3rd party c code included in an iOS project:

static int __attribute__((flatten)) f(struct node *node)

and Xcode gives a warning:

Unknown attribute 'flatten' ignored

What's the best way to kill this warning, without modifying the original source file?

falsetru
  • 357,413
  • 63
  • 732
  • 636
ohho
  • 50,879
  • 75
  • 256
  • 383

1 Answers1

2

Use #pragma directives around the #include of that file to ignore the appropriate warning (-Wunknown-attributes) or search your build settings and see if it the warning is listed there and disable it.

borrrden
  • 33,256
  • 8
  • 74
  • 109
  • 1
    Additionally, it might be a good idea to surround that with `#pragma clang diagnostics push` and `pop` (see the [clang manual](http://clang.llvm.org/docs/UsersManual.html#controlling-diagnostics-via-pragmas). – DarkDust Aug 06 '13 at 07:04
  • 1
    @DarkDust That is what my first suggestion was >_> – borrrden Aug 06 '13 at 07:05