forked from OSchip/llvm-project
30 lines
793 B
C
30 lines
793 B
C
// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s -std=c99
|
|
// PR4287
|
|
|
|
#include <stdarg.h>
|
|
char *foo = "test";
|
|
int test(char*,...);
|
|
|
|
int test(fmt) // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
|
|
char*fmt;
|
|
{
|
|
va_list ap;
|
|
char*a;
|
|
int x;
|
|
|
|
va_start(ap,fmt);
|
|
a=va_arg(ap,char*);
|
|
x=(a!=foo);
|
|
va_end(ap);
|
|
return x;
|
|
}
|
|
|
|
void exit(); // expected-warning {{a function declaration without a prototype is deprecated in all versions of C}}
|
|
|
|
int main(argc,argv) // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C2x}}
|
|
int argc;char**argv;
|
|
{
|
|
exit(test("",foo));
|
|
}
|
|
|