Files
ioccc/1985/august/august.c
T
Cody Boone Ferguson dadcaf92c4 Add second arg to main() in 1985/august
Due to clang defect in number of args allowed in main(). Some versions
will if you use, say, 4 args, object and report that main() can only
have 0, 2 or 3 args. That same version does not appear to object to 1
arg (bug?) but it's entirely possible that this changes so I have
changed the number of args of main() to 2 even though it's unused just
out of abundance of caution.

Updated CSILENCE for no implicit int. I have to test the unused
parameter warning. That might need to be added to,
-Wno-unused-parameter, but I have to find out which compilers will or
will not object to it and that can come later on.
2023-11-25 04:23:47 -08:00

15 lines
527 B
C

#define p struct c
#define q struct b
#define h a->a
#define i a->b
#define e i->c
#define o a=(*b->a)(b->b,b->c)
#define s return a;}q*
#define n (d,b)p*b;{q*a;p*c;
#define z(t)(t*)malloc(sizeof(t))
q{int a;p{q*(*a)();int b;p*c;}*b;};q*u n a=z(q);h=d;i=z(p);i->a=u;i->b=d+1;s
v n c=b;do o,b=i;while(!(h%d));i=c;i->a=v;i->b=d;e=b;s
w n o;c=i;i=b;i->a=w;e=z(p);e->a=v;e->b=h;e->c=c;s
t n for(;;)o,main(-h,0),b=i;}main(b,f)char**f;{p*a;if(b>0)a=z(p),h=w,a->c=z(p),a->c->a=u,
a->c->b=2,t(0,a);putchar(b?main(b/2,0),-b%2+'0':10);}