<story><title>The Shortest Crashing C Program</title><url>http://llbit.se/?p=1744</url></story><parent_chain><item><author>femto</author><text>It depends on the definition. You can do better than this if you define a valid C program as anything that passes though the C compiler and generates an executable. Behold the zero length program:&lt;p&gt;$ touch a.c&lt;p&gt;$ gcc -c a.c&lt;p&gt;$ ld a.o&lt;p&gt;ld: warning: cannot find entry symbol _start; defaulting to 0000000000400078&lt;p&gt;$ ./a.out&lt;p&gt;Segmentation fault</text></item></parent_chain><comment><author>lgeek</author><text>You can build it with a single command:&lt;p&gt;gcc -nostdlib ./empty.c -o ./empty&lt;p&gt;Edit: This one actually runs correctly:&lt;p&gt;&lt;pre&gt;&lt;code&gt;    $ touch empty.c
    $ gcc -static -nostartfiles ./empty.c -e_exit -o ./empty
    $ ./empty &amp;#38;&amp;#38; echo $?
    &amp;#62; 0&lt;/code&gt;&lt;/pre&gt;</text></comment>
<story><title>The Shortest Crashing C Program</title><url>http://llbit.se/?p=1744</url></story><parent_chain><item><author>femto</author><text>It depends on the definition. You can do better than this if you define a valid C program as anything that passes though the C compiler and generates an executable. Behold the zero length program:&lt;p&gt;$ touch a.c&lt;p&gt;$ gcc -c a.c&lt;p&gt;$ ld a.o&lt;p&gt;ld: warning: cannot find entry symbol _start; defaulting to 0000000000400078&lt;p&gt;$ ./a.out&lt;p&gt;Segmentation fault</text></item></parent_chain><comment><author>thristian</author><text>That&apos;s a shame. At least in one point in history, that was the shortest-known quine:&lt;p&gt;&lt;a href=&quot;http://www.ioccc.org/years.html#1994_smr&quot; rel=&quot;nofollow&quot;&gt;http://www.ioccc.org/years.html#1994_smr&lt;/a&gt;</text></comment>