1 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -triple x86_64-unknown-windows-msvc -fsyntax-only -verify %s
4 int printf(const char *restrict
, ...);
9 long c
: 32; // assumes that int is 32 bits
10 unsigned long d
: 32; // assumes that int is 32 bits
13 void bitfield_promotion(void) {
14 printf("%ld", bf
.a
); // expected-warning {{format specifies type 'long' but the argument has type 'int'}}
15 printf("%lu", bf
.b
); // expected-warning {{format specifies type 'unsigned long' but the argument has type 'int'}}
16 printf("%ld", bf
.c
); // expected-warning {{format specifies type 'long' but the argument has type 'int'}}
17 printf("%lu", bf
.d
); // expected-warning {{format specifies type 'unsigned long' but the argument has type 'unsigned int'}}