Apple LLVM 4.2, list of available __ attributes __ (()) for Objective-C

I am looking for a list of available __attribute__(()) directives, and I cannot find them. I only know __attribute__((objc_requires_super)) .

I swear I was looking and looking, and I did not find anything. Perhaps I am missing some term to include in my search.

Thank you very much.

+6
source share
3 answers

I just read this blog post and I think this is exactly what I was looking for.

https://blog.twitter.com/2014/attribute-directives-in-objective-c

+2
source

Documents can sometimes lag. For a complete list, there is no more modern place than the source code!

https://github.com/llvm-mirror/clang/blob/master/include/clang/Basic/Attr.td

Here is an example:

 def Visibility : InheritableAttr { let Clone = 0; let Spellings = [GNU<"visibility">, CXX11<"gnu", "visibility">]; let Args = [EnumArgument<"Visibility", "VisibilityType", ["default", "hidden", "internal", "protected"], ["Default", "Hidden", "Hidden", "Protected"]>]; } 

Here we see how it is defined in GNU and CXX11 GNU. It also shows valid arguments in this case (default, hidden, internal, protected).

+7
source

I found the information you need on the site del llvm.org. You can see this link: http://clang.llvm.org/docs/LanguageExtensions.html#objective-c-features

+4
source

Source: https://habr.com/ru/post/950525/


All Articles