Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/58.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C 按位属性_C_Gcc_Attributes - Fatal编程技术网

C 按位属性

C 按位属性,c,gcc,attributes,C,Gcc,Attributes,GCC的\uuuuuuu属性(按位)是什么意思?GCC-4.6的信息页面中未提及该属性。我在源代码项目中的文件open-iscsi-2.0.871/include/iscsi_proto.h中偶然发现了它,它被用作 ... /* * If running svn modules we may need to define these. * This should not go upstream since this is already properly defined there */

GCC的
\uuuuuuu属性(按位)
是什么意思?GCC-4.6的信息页面中未提及该属性。我在源代码项目中的文件
open-iscsi-2.0.871/include/iscsi_proto.h
中偶然发现了它,它被用作

...
/*
 * If running svn modules we may need to define these.
 * This should not go upstream since this is already properly defined there
 */
#ifdef __CHECKER__
#define __bitwise__ __attribute__((bitwise))
#else
#define __bitwise__
#endif
#ifdef __CHECK_ENDIAN__
#define __bitwise __bitwise__
#else
#define __bitwise
#endif

/*! initiator tags; opaque for target */
typedef uint32_t __bitwise__ itt_t;
/*! below makes sense only for initiator that created this tag */
#define build_itt(itt, age) ((__force itt_t)\
    ((itt) | ((age) << ISCSI_AGE_SHIFT)))
#define get_itt(itt) ((__force uint32_t)(itt_t)(itt) & ISCSI_ITT_MASK)
#define RESERVED_ITT ((__force itt_t)0xffffffff)
...
。。。
/*
*如果运行svn模块,我们可能需要定义这些模块。
*这不应该向上游移动,因为已经在那里正确定义了
*/
#ifdef_uu检测器__
#定义按位的属性((按位))
#否则
#按位定义__
#恩迪夫
#如果定义检查__
#按位定义__
#否则
#按位定义
#恩迪夫
/*! 启动器标签;对目标不透明*/
typedef uint32按位输入;
/*! 以下内容仅适用于创建此标记的启动器*/
#定义建造itt(itt,年龄)((强制itt)\

((itt)|((年龄)谷歌说按位不再有什么意义。

这显然不是GCC使用的,而是Linux内核使用的C的语义解析器使用的。它在中有记录。

它确实有意义!如果您正在编写Linux设备驱动程序并在大端设备上运行,但控制器正在用小端设备向您发送消息,那么最好确保在适当的位置使用适当的_le_to_cpu()宏。