
gcc
dbitc
这个作者很懒,什么都没留下…
展开
-
gcc的__attribute__参数
gcc __attribute__原创 2023-02-19 10:53:13 · 336 阅读 · 0 评论 -
结构体取元素位置
实用系列之结构体元素位置。原创 2022-08-17 09:29:40 · 299 阅读 · 0 评论 -
printk多参数调用相关
调用1:#define drv_prt(fmt, arg...) \drv_printk("[%-028s][%-04d] "fmt" \n", __func__, __LINE__, ## arg);调用2:#define drv_prt(fmt, ...) \drv_printk("[%-028s][%-04d] "fmt" \n", __func__, __LINE__, ##__VA_ARGS__));调用3void drv_原创 2022-05-09 15:01:06 · 236 阅读 · 0 评论 -
mips汇编相关
编译选项:Delay slot instruction – MIPShttps://www.mips.com/forums/topic/delay-slot-instruction/MIPS Options (Using the GNU Compiler Collection (GCC))MIPS Options (Using the GNU Compiler Collection (GCC))https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/MIPS-Opti原创 2021-12-25 17:16:13 · 826 阅读 · 0 评论 -
printf格式中的%.*s表法的意义
转自:http://blog.youkuaiyun.com/yss28/article/details/53538063printf格式中的%.*s表法的意义.表示左对齐,*表示精度。*表示输出位数,具体的数据来自参数表printf格式字符串中与宽度控制和精度控制有关的常量都可以换成变量,方法就是使用一个“*”代替那个常量,然后在后面提供变量给“*”扩展的,还有:%.*原创 2021-09-20 18:38:47 · 278 阅读 · 0 评论 -
嵌入式编程中的部分不常见宏定义
__PTRDIFF_TYPE__:__PTRDIFF_TYPE__ is an implementation detail of GCC's stddef.h#ifndef __PTRDIFF_TYPE__#define __PTRDIFF_TYPE__ long int#endiftypedef __PTRDIFF_TYPE__ ptrdiff_t;__signed____signed__和signed之间的区别在于命名空间。signed名称只能在__KERNEL__而不能在外部使.原创 2021-09-20 18:35:47 · 192 阅读 · 0 评论 -
可变长度参数的应用方式
va_list 直接函数定义:va_list是编译器内嵌的一种函数。typedef __builtin_va_list __gnuc_va_list;typedef __gnuc_va_list va_list;int dbg_print(const char *fmt, ...){ int len; char buf_tmp[1024]; va_list args; va_start(args, fmt); printed_l.原创 2021-03-12 20:10:33 · 334 阅读 · 1 评论 -
GCC 的宏预定义列表
http://gcc.gnu.org/onlinedocs/cpp/Predefined-Macros.html Several object-like macros are predefined; you use them without supplying their definitions. They fall into three classes: standard,转载 2016-12-11 17:58:15 · 288 阅读 · 0 评论 -
__attribute__((packed))详解
http://blog.chinaunix.net/uid-25768133-id-3485479.html1. __attribute__ ((packed)) 的作用就是告诉编译器取消结构在编译过程中的优化对齐,按照实际占用字节数进行对齐,是GCC特有的语法。这个功能是跟操作系统没关系,跟编译器有关,gcc编译器不是紧凑模式的,我在windows下,用vc的编译器也不是紧凑的,转载 2017-01-25 20:58:34 · 331 阅读 · 0 评论