char-unsigned.c 227 B

123456789101112
  1. #define MASK ((1 << __CHAR_BIT__) - 1)
  2. void foo(void)
  3. {
  4. _Static_assert((char) -1 == (-1 & MASK), "plain char is not unsigned");
  5. }
  6. /*
  7. * check-name: funsigned-char
  8. * check-command: sparse -funsigned-char -Wno-decl $file
  9. */