xref: /illumos-gate/usr/src/tools/smatch/src/validation/bitfields.c (revision 0aaef2f550fa500248f59b0b8a14225b5afbd198)
1 /*
2  * Al Viro points out that we don't
3  * do bitfield -> integer promotions
4  * for array dereferences
5  *
6  * "warning: a.c:16:10: incompatible types for operation"
7  */
8 static struct {
9 	int x:4;
10 } y;
11 
12 extern int a[];
13 
14 static int b(void)
15 {
16 	return a[y.x];
17 }
18 
19 /*
20  * check-name: bitfield to integer promotion
21  */
22