scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

0151-vararg.c (255B)


      1 struct foo {
      2 	int i, j, k;
      3 	char *p;
      4 	float v;
      5 };
      6 
      7 int
      8 f1(struct foo f, struct foo *p, int n, ...)
      9 {
     10 	if (f.i != p->i)
     11 		return 0;
     12 	return p->j + n;
     13 }
     14 
     15 int
     16 main(void)
     17 {
     18 	struct foo f;
     19 
     20 	f.i = f.j = 1;
     21 	f1(f, &f, 2);
     22 	f1(f, &f, 2, 1, f, &f);
     23 
     24 	return 0;
     25 }