- From: Harald van Dĳk <truedfx@xxxxxxxxx>
- Date: Sat, 12 Jan 2008 00:50:09 +0100
On Fri, 11 Jan 2008 17:52:32 -0500, Kenneth Brody wrote:
[Note: The example from smr is an empty file, and won the "Worst Abuse
of the Rules" award at the 1994 Obfuscated C Code contest.]
Meaning that you cannot run the program, meaning that no output will be
generated, meaning that you have just generated the source code.
(Perhaps the original rules allowed such a loophole?)
No, that is not the loophole.
Quoting from <http://www.de.ioccc.org/1994/smr.hint>:
While strictly speaking, smr.c is not a valid C program, it is
not an invalid C program either! Some C compilers will compile
an empty file into a program that does nothing. But even if your
compiler can't, the build instructions supplied with this entry
will produce an executable file. On most systems, the stdout
from the executable will exactly match original source.
Of course, this is wrong as far as relevant for this group. While
compilers are certainly allowed to translate empty source files into
executables that do nothing, or even executables that do something, such
programs violate a constraint and the compiler must issue a diagnostic.
If the implementation chooses not to make this diagnostic a hard error,
that's fine, but it doesn't make the code any less invalid as C.
(And the build instructions referenced don't interpret the program as C
- Prev by Date: Re: Problems reserving memory with the 'malloc' command
- Next by Date: Re: Why this works???
- Previous by thread: Re: Quines
- Next by thread: Re: Quines