Mail Archives: djgpp/2001/10/11/07:34:49
Radical wrote:
> Just what the HE** other choices would you want for
> main other than "int" or "void" ??????
You don't want void, either. Not in any portable program, that is.
"void main" is an extremely bad habit introduced by extremely lazy
programmers, and by irresponsible authors writing books for those lazy
guys. No standard definition of C (on 'real' computers, i.e. what the
standard calls a "hosted environment") allows void main.
> Why/How make it more complicated? For what reason
> is there to say if it is NOT explicitly given, its an "int",
main() is not special in this regard. Any function in old-fashioned
K&R C was assumed to return int if your source didn't say otherwise.
ANSI C grudgingly allowed this, too, as a compromise to allow existing
sources still to be compiled.
But it's icky enough that during C99 standardization, the committee
finally ruled it out as no longer allowed. It's only after serious
consideration that such a standardization committee ever kill existing
source code like that, so this is quite a strong verdict, actually.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -