xref: /illumos-gate/usr/src/tools/smatch/src/validation/char-unsigned.c (revision 1edba515a3484e0f74b638b203d462b3112ac84d)
1 #define	MASK ((1 << __CHAR_BIT__) - 1)
2 
3 void foo(void)
4 {
5 	_Static_assert((char) -1 == (-1 & MASK), "plain char is not unsigned");
6 }
7 
8 /*
9  * check-name: fsigned-char
10  * check-command: sparse -funsigned-char -Wno-decl $file
11  */
12