__attribute__

https://www.cnblogs.com/marvin-notes/p/4482805.html

分类

函数属性

aligned
alloc_size
noreturn
returns_twice
noinline, noclone
always_inline
flatten
pure
const
nothrow
sentinel
format
format_arg
no_instrument_function
no_split_stack, section
constructor, destructor
used
unused
deprecated
weak
malloc
alias
ifunc
warn_unused_result
nonnull
gnu_inline
externally_visible
hot
cold
artificial
error
warning

变量属性

aligned
cleanup
common
nocommon
deprecated
mode
packed
section
shared
tls_model
unused
used
vector_size
selectany
weak
dllimport
dllexport

类型属性

aligned
packed
transparent_union unused
deprecated
visibility
and may_alia

我就是大概罗列下,其实有些属性可以修饰不止一种属性类型。不做过多介绍。

Clang 扩展的属性

availability
overloadable



作者:充满活力的早晨
链接:https://www.jianshu.com/p/e2dfccc32c80
来源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。
posted @ 2019-07-05 11:08  MoonXu  阅读(183)  评论(0编辑  收藏  举报