R
Richard Heathfield
Randy said:Perhaps. The response I received was basically (paraphrasing) "Thank you,
but I have asked on comp.lang.c about this in the past, and nobody could
point to a single system that would actually crash with void main()."
Firstly, that's not the point. The behaviour is undefined, and he shouldn't
be promulgating egregious undefined behaviour.
Secondly, I have searched the Google archives, and could find only one
article by Dan Gookin in comp.lang.c, which didn't mention main() at all.
Thirdly, several such hardware systems have been identified (did the author
think to check Google?), and it's trivial to construct a software system
that could crash on void main, even on a Microsoft platform:
@echo off
voidmainprg.exe
if errorlevel 2 goto spacecadet
if errorlevel 1 goto failed
echo It worked.
goto end
:spacecadet
echo Here we go...
rem insert your favourite Windows exploit here
spacecadet.exe
:failed
echo It failed.
:end
He did mention that the books were written before the standard
Huh? It was published in 1997, almost a decade /after/ the Standard.