GCC Bitwise Attribute


What does GCC's __attribute__(bitwise) mean? The attribute isn't mentioned in the info pages of GCC-4.6. I stumbled upon it in the file open-iscsi-2.0.871/include/iscsi_proto.h in source the project Open-ISCSI where it is used as

 * 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))
#define __bitwise__
#ifdef __CHECK_ENDIAN__
#define __bitwise __bitwise__
#define __bitwise

/*! 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)

I'm suspecting something involving byte-order but I can't make any sense of the snippet given above.

asked on Stack Overflow Oct 28, 2011 by Nordlöw • edited Aug 4, 2020 by Nordlöw

2 Answers


This is apparently not used by GCC but by Sparse, a semantic parser for C used by the Linux kernel. It is documented in Documentation/dev-tools/sparse.txt.

answered on Stack Overflow Oct 28, 2011 by Schnouki • edited Jun 27, 2020 by Feng. Ma

Google says here that bitwise don't mean much anymore.

User contributions licensed under CC BY-SA 3.0