[Zlib-devel] exit() vs. return in main()
Cosmin Truta
cosmin at cs.toronto.edu
Wed Mar 12 20:41:00 EST 2003
Gilles Vollant wrote:
> Note that contrib/minizip/zip.c and minizip.c must also be modified
I saw the following funny lines in example/minizip/minigzip etc:
int main(argc, argv)
{
/* ... */
exit(0);
return 0; /* to avoid warning */
}
Why this redundancy? Either choose "void main() { ... exit(0); }",
or "int main() { ... return 0; }".
Also, if you have "int main()" and you want to be consistent, you can
replace
if (something)
exit(errcode);
with
if (something)
return errcode;
=or=
replace "int main()" with "void main()" and use exit() everywhere.
Cosmin
More information about the Zlib-devel
mailing list