brintos

brintos / llvm-project-archived public Read only

0
0
Text · 793 B · d5b49f5 Raw
30 lines · c
1// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s -std=c992// PR42873 4#include <stdarg.h>5char *foo = "test";6int test(char*,...);7 8int test(fmt) // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}9        char*fmt;10{11        va_list ap;12        char*a;13        int x;14 15        va_start(ap,fmt);16        a=va_arg(ap,char*);17        x=(a!=foo);18        va_end(ap);19        return x;20}21 22void exit(); // expected-warning {{a function declaration without a prototype is deprecated in all versions of C}}23 24int main(argc,argv) // expected-warning {{a function definition without a prototype is deprecated in all versions of C and is not supported in C23}}25        int argc;char**argv;26{27        exit(test("",foo));28}29 30