void main(argc, argv)

ORCUTT at cc.utah.edu ORCUTT at cc.utah.edu
Tue Nov 21 04:24:40 AEST 1989


I always use return instead of exit when I am
returning from main.  I do this because most
compilers know that code after a block closed
by return is dead code, like when both branches
if an if ... else block end in a return.  I thus
get warnings about such code.  I reserve exit
for returning for functions below main in the
tree.  For this reason, I always declare main
as returning an int to avoid warnings from compilers
that don't like void functions to return values.



More information about the Comp.lang.c mailing list