__attribute__ 用法
来源:互联网 发布:星际皆知你爱我网盘 编辑:程序博客网 时间:2024/06/10 07:41
最近在看项目代码的时候发现了新大陆,之前从没有用过__attribute__,
根据代码和网上看到的资料,总结一下 __attribute__ 的常用用法~
1.__attribute__((packed))取消结构体对齐。
用例:
typedef struct __attribute__((packed))
{
UBYTE sts;
}ST_USB_POWER_RES;
2.__attribute__((__noreturn__)) 告诉编译器,函数不会返回
void __throw_bad_typeid(void) __attribute__((__noreturn__));
3.将变量定义在特定位置
static unsigned char Uart12_Send_Data_Buf [LOG_SEND_BUF_SIZE] __attribute__ ((section (".uncache_edram")))= {0};
阅读全文
0 0
- __attribute__用法
- __attribute__ 用法
- GNU C __attribute__ 用法
- __attribute__用法小结
- __attribute__((pack))的用法
- __attribute__((noreturn))的用法
- __attribute__ ((packed))用法
- __attribute__ noreturn 用法
- 函数属性__attribute__的用法
- __attribute__的一些小用法
- GUN C/C++ __attribute__ 用法
- __attribute__ ((packed)) 的作用 用法
- Object-c __attribute__((overloadable))) 用法
- __attribute__
- __attribute__
- __attribute__
- __attribute__
- __attribute__
- 基础备忘
- .netFramewo 4.0软件报 未能加载文件或程序集“System.Core, Version=2.0.5.0错误处理
- Hadoop和大数据:60款顶级开源工具
- fzu2265Card Game (Second Edition) (数学)(简单)
- 02_利用rand7() 产 生 rand10() 1~10(均匀概率)
- __attribute__ 用法
- 几种常用的最短路的求法
- 链表是否构成环、环的长度以及环的入口点的求法
- squid代理安装步骤
- uikit——UIView——content
- Jquery超简单遮罩层实现代码
- MySql 学习
- HDU-1051Wooden Sticks (贪心)
- HDU 4253 Two Famous Companies