File: enum-bitwise.c

package info (click to toggle)
sparse 0.6.5~rc1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,768 kB
  • sloc: ansic: 46,405; sh: 614; perl: 299; python: 296; makefile: 282
file content (19 lines) | stat: -rw-r--r-- 436 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#define __bitwise __attribute__((bitwise))
#define __force   __attribute__((force))

typedef long long __bitwise bits;

enum r {
	RZ = (__force bits) 0,
	RO = (__force bits) 1,
	RM = (__force bits) -1,
};

_Static_assert([typeof(RZ)] == [bits], "RZ");
_Static_assert([typeof(RO)] == [bits], "RO");
_Static_assert([typeof(RM)] == [bits], "RM");
_Static_assert(sizeof(enum r) == sizeof(bits), "bits");

/*
 * check-name: enum-bitwise
 */