blob: d2870a887019394060bcb04c5047e1ca68d41da2 [file] [log] [blame]
/* { dg-options "-Wformat" } */
int main (int argc, char **argv)
{
char buf[10];
char c[] = "%i";
unsigned char uc[] = "%i";
const char cc[] = "%i";
const unsigned char cuc[] = "%i";
__builtin_sprintf(buf, (char *)c, 1);
__builtin_sprintf(buf, (char *)uc, 1);
__builtin_sprintf(buf, (char *)cc, 1);
__builtin_sprintf(buf, (char *)cuc, 1); /* { dg-warning "format string is not an array of type 'char'" } */
__builtin_sprintf(buf, (const char *)L"foo"); /* { dg-warning "format is a wide character string" } */
return 0;
}