GCC Bitwise Attribute

10

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))
#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)
...

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

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

2 Answers

14

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
2

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


User contributions licensed under CC BY-SA 3.0