1 #include <stdio.h>
2 #include <stdarg.h>
3
4 int
foo()5 foo() {
6 return puts("hello");
7 }
8
9 static void bogus(int);
10
11 extern void
bogus(int x)12 bogus(int x) {
13 printf("%d\n", x);
14 }
15
16 static void bogus(int);
17
18 static int lol = 7;
19 extern int lol;
20
varfunc(char * fmt,...)21 void varfunc(char *fmt, ...)
22 {
23 va_list va;
24 va_list *pva = &va;
25 va_list **ppva = &pva;
26 void *p;
27
28 va_start(va, fmt);
29 p = ( 1? __builtin_va_arg(va, void *): 0);
30 }
31
32 typedef char *tdef;
33
34 int
main()35 main() {
36 void (*stuff[1])();
37 char buf[10];
38 char *cp = buf;
39 unsigned short us[] = { 'h', 'e', 'l', 'l', 'o', 0 };
40 unsigned short *usp = us;
41 int stuffint = { 3233, };
42
43
44 stuff[0] = (void(*)())foo;
45 printf("%d\n", ((int(*)())stuff[0])());
46 for (usp = us; *usp != 0;) {
47 *cp++ = *usp++;
48 }
49 *cp = 0;
50 puts(buf);
51 printf("%d, %d\n", stuffint, lol);
52 bogus(128);
53 {
54 char *p = "hello";
55 char **tdef = &p;
56 (tdef)[0];
57 printf("%d\n", (int)strlen((tdef[0])));
58 }
59
60 varfunc(NULL, 128);
61 }
62
63