1/* case16.c */
2void badFunc(int *badStyle);
3int dots_0(int p1);
4int dots_1(int p1, ...);
5int dots_3(int P1, char P2, ...);
6_FIRST *func1(void);
7_FIRST *func2(_FIRST *P1 , int P2 [], float p);
8int *(func_func)(int p1, int p2, int p3);
9int main(register argc, char **argv);
10int veryfunny(char *a, long b, long c);
11int program(string argv[], struct alpha y, int zz, int z1, int z2, int z3);
12int junk0(void);
13int junk1(void);
14int junk2(void);
15int junk3(void);
16BONG *junk4(void);
17extern_junk *foo(void);
18void_junk *foo2a(void);
19void_junk *foo2(void);
20void_junk *foo_void(void_junk void_int);
21void (*Sigdisp(int sig, void (*func)(int sig)))(int sig1);
22void (*sigdisp2(int sig, void (*func)(int sig)))(int sig2);
23int (*K_R_INT_ptr(long *p1, int p2))(void);
24void (*K_R_VOID_ptr(long *p1, int p2))(void);
25int *K_R_int_ptr(long *p1, int p2);
26void *K_R_void_ptr(long *p1, int p2);
27int K_R_int_val(long *p1, int p2);
28int K_R_int_val2(long *p1, int p2);
29void K_R_void_val(long *p1, int p2);
30int K_R_void_val2(long *p1, int p2);
31... edited case16.c ...
32/*
33 * Define:
34 *	ERR_YACC	to force yacc error reporting
35 *	ERR_LEX		to force lex error reporting
36 *	ERR_CHECK	to force compiler error reporting
37 */
38		/* use one item from type-specifiers */
39#ifdef	ERR_YACC
40auto		x;
41register	x1;
42#endif	/* ERR_YACC */
43static		x2;
44extern		x3;
45#ifdef	ERR_CC
46typedef		x4;
47#endif
48typedef	int	x4t;
49#ifdef	ERR_YACC
50void		x5;
51#endif	/* ERR_YACC */
52char		x6;
53short		x7;
54int		x8;
55long		x9;
56float		x10;
57double		x11;
58signed		x12;
59unsigned	x13;
60struct		x14;
61#ifdef	ERR_CHECK
62struct		x14a {};
63struct		{};
64#endif	/* ERR_CHECK */
65union		x15;
66enum		x16;
67x4t;
68x4t		x17;
69const		x18;
70volatile	x19;
71#ifdef	ERR_CHECK
72junk		x20;
73#endif	/* ERR_CHECK */
74
75extern int *asm (fopen, (__const char *__restrict __filename, __const char *__restrict __modes), fopen64);
76extern int __asm__ (mkstemp, (char *__template), mkstemp64);
77int __asm__ (mkstemp, (char *__template), mkstemp64);
78asm("something");
79asm("something", "else");
80asm("something", (this and that));
81int asm(first, "something");
82static int asm(first, "something");
83extern int asm(first, "something");
84
85typedef	struct	_first	{
86	int		a:5;
87	struct	{
88		int	a,b;
89	} b_struct;
90	char		b:16, b1:1;	/* comment with };};}; */
91	long		c:16, c1;
92	short		d:16, d1:8, d2;
93	unsigned	e:16;
94	float		f;
95	double		g;
96#ifdef	ERR_CHECK
97	long	float	f2;
98	long	double	g2;
99#endif	/* ERR_CHECK */
100	struct	_first	*link;
101	}	_FIRST;
102
103typedef int badStyle;
104void badFunc(int *badStyle) { }
105
106_FIRST	first, last={0}, first_last[] = {{0},{1},{2},{3,{4}}};
107
108struct	_second	{
109		enum	{true, false} bool;
110		enum	{wrong=1, right=3} values;
111	} _SECOND;
112
113int	i[] = {1,
114		'\002',
115		03,
116		0x4,
117		0X5,
118		0x6a,
119		0X7b,
120		0x8aBcD,
121		9l,
122		10l,
123		11L};
124float	f[] = {5,
125#ifdef	ERR_CHECK
126		.5e,
127		.5e+,
128		5e-,
129		5e,
130		.34P1,
131		0x1.2.34,	/* error */
132#endif
133		.5,
134		5.5,
135		5e5,
136		5e0,
137		5e-1,
138		5e+5
139#ifdef	__STDC_VERSION__ /* ( C9X supports hexadecimal floating point ;-) */
140		0x12.34+1,
141		0x12.34P1,
142		.34e1,
143		0.34e1,
144		0x.34P1,
145#endif
146		.0e-1
147		};
148
149int	array[][10][20];
150
151	/*
152	 * This grammar can accept some illegal stuff too, in particular it will
153	 * permit some instances of parameter-names to be dropped.
154	 */
155#ifdef	ERR_CHECK
156#define	P1
157#define	P2
158#define	P3
159#else
160#define	P1	p1
161#define	P2	p2
162#define	P3	p3
163#endif
164
165	/* ellipsis is legal, except in K&R style declaration */
166
167	int
168dots_0 (int p1)		{ return(1); }
169
170	dots_1(int p1, ...)	{ return(1); }
171
172#ifdef	ERR_CHECK
173	dots_2(p1, ...)		{ return(1); }
174#endif	/* ERR_CHECK */
175
176	dots_3(int P1,char P2, ...)	{ return(1); }
177
178int	dots_4(int,char, char *);
179char *	dots_5(int,char, char *, ...);
180char *	(dots_6)(int,char, char *, ...);
181
182extern	_FIRST *xdots_0(p1);
183
184extern	char *xdots_1(int p1, ...);
185
186#ifdef	ERR_CHECK
187extern	xdots_2(p1, ...);
188#endif	/* ERR_CHECK */
189
190extern	xdots_3(int P1,char P2, ...);
191
192_FIRST *
193func1 (void) { }
194_FIRST	*func2(_FIRST *P1,int P2[],float p) { }
195
196int *(
197func_func) (int p1, int p2, int p3)	{ return(0); }
198
199extern	float	efunc0(p1,p2,p3);
200extern	_FIRST	efunc1(int p1, float p2,long P3);
201#ifdef	ERR_CHECK
202extern	_FIRST	efunc1(int p1, float p2,p3);
203#endif	/* ERR_CHECK */
204
205
206typedef	int	bool;
207
208bool	a1;
209static	bool	a2;
210extern	bool	a3;
211
212struct	ZIP1	{ int x1, y1; };
213struct	zip2	{ int x2, y2; } z2;
214struct		{ int x3, y3; } z3;	/* not ANSI, but mostly accepted */
215
216static	struct	ZIP4	{ int x4, y4; };
217static	struct	zip5	{ int x5, y5; } z5;
218static	struct	zip6	{ int x6, y6; } z6, w6;
219static	struct		{ int x7, y7; } z7;
220static	struct		{ int x8, y8; } z8, w8;
221
222enum	zap1	{ a,b,c,d }	what;
223enum	zap2			what2;
224enum		{a9,b9,c9,d9}	what3;
225
226static	char	*zap = "alphabet/\
227first/\
228last";
229typedef	struct	bong	{
230	int	(*func)();
231	} BONG;
232
233typedef	char	*string;
234
235#ifdef	ERR_LEX
236string	s = "aaa\0000\
237
238bbb";
239#endif	/* ERR_LEX */
240
241extern	int	junk;
242
243int
244main (register argc, extern char **argv)
245{
246}
247
248/*VARARGS*/
249/* some other comment */
250int
251veryfunny (char *a, long b, long c)
252{
253	return 0;
254}
255
256/*VARARGS3*/
257int
258program (
259    string argv[],	/* first argument */
260    struct alpha y,	/* second argument */
261    int zz,
262    int z1,
263    int z2,
264    int z3
265)
266{
267	return(0);
268}
269
270int
271junk0 (void) { if(junk != 6) return; else junk++; }
272int
273junk1 (void) { return (0); }
274int
275junk2 (void) { }
276int
277junk3 (void) { return 1; }
278
279BONG *
280junk4 (void) { }
281
282typedef	int	extern_junk;
283extern_junk *
284foo (void) { }
285
286typedef	int	void_junk;
287extern void_junk *
288foo2a (void) { }
289extern void_junk	*foo2a();
290void_junk *
291foo2 (void) { }
292void_junk	*foo_void(void_junk void_int) { }
293static void_junk *
294foo_void2 (void) { }
295
296extern void (*sigdisp(int sig, void (*func)(int sig)))(int sig);
297
298void (*Sigdisp(int sig, void (*func)(int sig)))(int sig1)
299{ /* nothing */ }
300
301void (*
302sigdisp2 (
303    int sig,		/* the signal value */
304    void (*func)(int sig)	/* the function pointer */
305))(int sig2)
306{ /* nothing again! */ }
307
308int (*
309K_R_INT_ptr (long *p1, int p2))(void) { return (*(int(*)())0); }
310
311int (*STD_INT_ptr(long* , int))();
312
313void (*
314K_R_VOID_ptr (long *p1, int p2))(void) { return (*(void(*)())0); }
315
316void (*STD_VOID_ptr(long* , int))();
317
318int *
319K_R_int_ptr (long *p1, int p2) { return (*(int **)0); }
320
321int **STD_int2_ptr(long* , int);
322
323int *STD_int_ptr(long* , int);
324
325void *
326K_R_void_ptr (long *p1, int p2) { return (*(void **)0); }
327
328void *STD_void_ptr(long* , int);
329
330int
331K_R_int_val (long *p1, int p2) { return (*(int *)0); }
332
333int
334K_R_int_val2 (long *p1, int p2) { return (*(int *)0); }
335
336int STD_int_val(long*, int);
337
338void
339K_R_void_val (long *p1, int p2) { /*void*/ }
340
341int
342K_R_void_val2 (
343    long *p1,
344    int p2 { /*void*/
345) }
346
347void STD_void_val(long* , int);
348
349extern	xdots_3(int P1,char P2, ...);
350
351extern int (*XSetAfterFunction(long* , int (*) ( long*)))();
352extern XQueryKeymap(long*, char [32]);
353extern Another(long*, int (*)());
354
355extern GenFunc(int *, int *());
356
357/* these are pointers, not actual functions */
358extern void * (*__glob_opendir_hook) (const char *__directory);
359extern const char *(*__glob_readdir_hook) (void * __stream);
360extern void (*__glob_closedir_hook) (void * __stream);
361
362/* inline function */
363int inline inline_func(double x) { return(0); }
364static int inline local_inline_func(double x) { return(0); }
365
366/* c99 types */
367long long xxx = 1;
368char *xxs = "\x1234\?\u1234";
369