Ian Phillipps <[EMAIL PROTECTED]> writes:

> On Thu, 28 Mar 2002 at 10:21:58 +1100, [EMAIL PROTECTED] wrote:
> 
> > open$%;print<0>
> > is indeed the shortest possible Perl quine.
> 
> No. The shortest possible Perl quine is, of course, the file which I've
> attached. It also works in C.  (This isn't original - I can't remember
> who pointed it out)

It's not a conforming ISO C program:

    <hal5 89 [17:12] ~ >touch null.c
    <hal5 90 [17:13] ~ >gcc -pedantic -Wall null.c
    null.c:1: warning: ANSI C forbids an empty source file
    /usr/lib/crt1.o: In function `_start':
    /usr/lib/crt1.o(.text+0x18): undefined reference to `main'
    collect2: ld returned 1 exit status

I think there are 2 separate issues here.  One is that translation
units may not be empty; the other is that a whatever-the-name-is-for-
-a-non-embedded-implementation must define an appropriate main()
function.


-- 
Ariel Scolnicov        |http://3w.compugen.co.il/~ariels
Compugen Ltd.          |[EMAIL PROTECTED]
72 Pinhas Rosen St.    |Tel: +972-3-7658117      "fast, good, and cheap;
Tel-Aviv 69512, ISRAEL |Fax: +972-3-7658555       pick any two!"

Reply via email to