GCC的__attribute__(bitwise)是什么意思?GCC-4.6的信息页面中没有提到这个属性。我是在源代码中的文件open-iscsi-2.0.871/include/iscsi_proto.h中偶然发现的,这个项目是Open-ISCSI,它被用作
...
/*
* 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)
...我怀疑涉及字节顺序的东西,但我无法理解上面给出的片段。
发布于 2011-10-28 15:21:50
这显然不是GCC使用的,而是由稀疏使用的,它是一个C的语义解析器,由Linux内核使用。它被记录在文档/dev-tools/spemse.txt中。
发布于 2011-10-28 15:20:49
谷歌表示,这里认为按位计算不再意味着什么。
https://stackoverflow.com/questions/7931063
复制相似问题