ChinaUnix.net
相关文章推荐:

Linux attribute

摘要: 在学习linux内核代码及一些开源软件的源码(如:DirectFB),经常可以看到有关__attribute__的相关使用。本文结合自己的学习经历,较为详细的介绍了__attribute__相关语法及其使用。 ---------------------------------------------------------------- 声明: 此文为原创,欢迎转载,转载请保留如下信息 作者:聂飞(afreez) 北京-中关村 联系方式: [email=afreez@sina.com]afreez@sina.com[/email] (...

by shawn_rin - Linux文档专区 - 2009-08-08 19:29:20 阅读(770) 回复(0)

相关讨论

1.Declaring attributes of Functions 我这里只列举常用,或者说是我认为常用,有用的 1.1 alias ("target"):函数别名 The alias attribute causes the declaration to be emitted as an alias for another symbol, which must be specified. For instance, void __f () { /* Do something. */; } void f () __attribute__ ((weak, alias ("__f"))); 1.2 constructor和destructor The c...

by ubuntuer - Linux文档专区 - 2009-04-30 13:19:02 阅读(1000) 回复(0)

引用: __attrubte__ ((packed)) 的作用就是告诉编译器取消结构在编译过程中的优化对齐,按照实际占用字节数进行对齐。 #define __u8 unsigned char #define __u16 unsigned short /* __attribute__ ((packed)) 的位置约束是放于声明的尾部“;”之前 */ struct str_struct{ __u8 a; __u8 b; __u8 c; __u16 d; } __attribute__ ((packed)); /* 当用到typedef时,要特别注意__attri...

by heijita - Linux文档专区 - 2009-11-28 18:42:09 阅读(693) 回复(0)

关于linux内核中的"__attribute__ ((packed))" 来源: http://jimmy-lee.blog.hexun.com/8001013_d.html __attrubte__ ((packed)) 的作用就是告诉编译器取消结构在编译过程中的优化对齐,按照实际占用字节数进行对齐。 #define __u8 unsigned char #define __u16 unsigned short /* __attribute__ ((packed)) 的位置约束是放于声明的尾部“;”之前 */ struct str_struct{ __u8 a; __u8 b; __...

by I-linux - Linux文档专区 - 2009-04-14 13:39:04 阅读(533) 回复(0)

关于linux内核中的"__attribute__ ((packed))" 来源: http://jimmy-lee.blog.hexun.com/8001013_d.html __attrubte__ ((packed)) 的作用就是告诉编译器取消结构在编译过程中的优化对齐,按照实际占用字节数进行对齐。 #define __u8 unsigned char #define __u16 unsigned short /* __attribute__ ((packed)) 的位置约束是放于声明的尾部“;”之前 */ struct str_struct{ __u8 a; __u8 b; _...

by mlch1816 - SCO文档中心 - 2015-05-18 17:51:17 阅读(18568) 回复(3)

功能说明:显示文件属性。 语  法:lsattr [-adlRvV][文件或目录...] 补充说明:用chattr执行改变文件或目录的属性,可执行lsattr指令查询其属性。 参  数: -a  显示所有文件和目录,包括以"."为名称开头字符的额外内建,现行目录"."与上层目录".."。 -d  显示,目录名称,而非其内容。 -l  此参数目前没有任何作用。 -R  递归处理,将指定目录下的所有文件及子目录一并处理。 -v  显示文件或目录版本。 -V  显示版本信...

by ximiff - Linux文档专区 - 2012-07-26 08:20:59 阅读(1254) 回复(2)

GNC CC 是一个功能非常强大的跨平台 C 编译器,它对 C 语言提供了很多扩展, 这些扩展对优化、目标代码布局、更安全的检查等方面提供了很强的支持。本文把 支持 GNU 扩展的 C 语言称为 GNU C。 linux 内核代码使用了大量的 GNU C 扩展,以至于能够编译 linux 内核的唯一编 译器是 GNU CC,以前甚至出现过编译 linux 内核要使用特殊的 GNU CC 版本的情 况。本文是对 linux 内核使用的 GNU C 扩展的一个汇总,希望当你读内核源...

by vicegod - Linux文档专区 - 2007-04-16 19:41:16 阅读(521) 回复(0)

struct ed { __u32 hwINFO; __u32 hwTailP; __u32 hwHeadP; __u32 hwNextED; struct ed * ed_prev; __u8 int_period; __u8 int_branch; __u8 int_load; __u8 int_interval; __u8 state; __u8 type; __u16 last_iso; struct ed * ed_rm_list; dma_addr_t dma; __u32 unused[3]; } __attribute((aligned(16))) 解释最后一行。

by cxtmail - 程序开发 - 2003-05-30 19:42:08 阅读(779) 回复(1)

struct ed { __u32 hwINFO; __u32 hwTailP; __u32 hwHeadP; __u32 hwNextED; struct ed * ed_prev; __u8 int_period; __u8 int_branch; __u8 int_load; __u8 int_interval; __u8 state; __u8 type; __u16 last_iso; struct ed * ed_rm_list; dma_addr_t dma; __u32 unused[3]; } __attribute((aligned(16))) 解释最后一行。

by cxtmail - Linux环境编程 - 2003-05-30 19:42:08 阅读(3190) 回复(1)

1. gcc__attribute__编绎属性

by lpzgbd - 移动操作系统 - 2016-07-10 14:50:00 阅读(1022) 回复(2)

typedef struct stPreTIMItem { int iFromOffset; //Offset from the file position 0 char bDownloadToFlash;//0 Not to flash,1 to Flash int iFileSize; int iFlashAddress; char bYaffsFile; //Only for User&System Yaffs int iYaffsSize; //For Yaffs Item use only char szFileName[256]; }STPreTIMItem; struct stHead { char magic[5]; int items; #define BITM...

by gliethttp - Linux文档专区 - 2008-03-04 16:21:59 阅读(563) 回复(0)