Smallest Self Reproducing Program
ioccc-src.github.io
ioccc-src.github.io
How do they define "invalid"? Section 6.7 (page 81) of the C89 standard defines a translation unit as a series of one or more external declarations.
I assumed that a main() function was a requirement, but section 5.1.2.2 (page 6) does not require this (which seems obvious in retrospect; that's how object files are compiled).
I think the shortest valid C program would be "f();". gcc accepts it. In fact, gcc agrees with my conclusion above, and says, for a blank file: "ISO C forbids an empty translation unit".
What do other compilers say?