Har*_*nry 5 c attributes arm clang
听起来我应该可以使用Google,但找不到很好的参考。到底是__attribute__((force))做什么的?如:
return (__attribute__((force)) uint32_t) *p
Run Code Online (Sandbox Code Playgroud)
(这是针对使用clang交叉编译的ARM系统,但是即使在clang / arm特定页面中,我也找不到此属性的任何引用。)
__attribute__((force)) 用于抑制 sparse 中的警告,Linux 内核的 c 语义检查器。
sparse的维基百科文章列出了 sparse 定义的以下属性:
如果您需要有关这些的更多信息,可以查看sparse 的手册页
在 linux 内核中,一些这些属性在linux/include/linux/compiler_types.h中重新定义。例如__force扩展到__attribute__((force))或__bitwise到__attribute__((bitwise))。
但是关于 sparse的linux 文档告诉我们,gcc 忽略了这些属性:
有了 gcc,所有的“__bitwise”/“__force 东西”都消失了,最终看起来就像 gcc 的整数一样。
| 归档时间: |
|
| 查看次数: |
691 次 |
| 最近记录: |