• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #define __bitwise __attribute__((bitwise))
2 #define __force   __attribute__((force))
3 
4 typedef long long __bitwise bits;
5 
6 enum a {
7 	AR = (__force bits) 0,
8 	AP = 0,
9 	AS = (__force bits) 1,
10 	AQ = 1,
11 };
12 _Static_assert(sizeof(AP) == sizeof(int), "is bad?");
13 
14 enum b {
15 	BP = 0,
16 	BR = (__force bits) 0,
17 	BQ = 1,
18 	BS = (__force bits) 1,
19 };
20 _Static_assert(sizeof(BP) == sizeof(int), "is bad?");
21 
22 /*
23  * check-name: enum-bitwise-mixed
24  *
25  * check-error-start
26 enum-bitwise-mixed.c:8:14: warning: mixed bitwiseness
27 enum-bitwise-mixed.c:16:15: warning: mixed bitwiseness
28  * check-error-end
29  */
30