From: jim@mentat.com (Jim Gillogly)
To: aba@dcs.ex.ac.uk
Message Hash: 8d0649805c1a6c3501836cf38a6d11464766c3fe0389a37ccca7be5a6d3a10d7
Message ID: <9711141643.AA18973@mentat.com>
Reply To: N/A
UTC Datetime: 1997-11-14 16:57:53 UTC
Raw Date: Sat, 15 Nov 1997 00:57:53 +0800
From: jim@mentat.com (Jim Gillogly)
Date: Sat, 15 Nov 1997 00:57:53 +0800
To: aba@dcs.ex.ac.uk
Subject: Re: smaller f00f.c
Message-ID: <9711141643.AA18973@mentat.com>
MIME-Version: 1.0
Content-Type: text/plain
Adam says:
> Hey, challenge is on:
>
> main(){int i=0xc8c70ff0;void (*f)()=&i;f();} /* f00fies 44 char */
> main(){((int(*)())"\360\017\307\310")();}
> main(){int i=0xc8c70ff0,(*f)()=&i;f();}
> main(i){int(*f)()=&i;i=0xc8c70ff0;f();}
> main(i){i=0xc8c70ff0;((int(*)())&i)();}
> (*f)();main(i){f=&i;i=0xc8c70ff0;f();}
> (*f)()="\360\017\307\310";main(){f();} /* 38 chars */
>
> Compiled with gcc.
long main=0xc8c70ff0; /* also gcc; 21 chars, and not my invention */
Without the "long" you get a warning, but it compiles anyway... 16 chars.
Jim Gillogly
jim@acm.org
Return to November 1997
Return to “jim@mentat.com (Jim Gillogly)”