| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | i`m a moron |
Am 25. Aug 96 19:54, schrieb Thomas Seeling (2:244/1130.42)
an Mario Semo:
Servus Thomas!
TS>>> and you should not use exit() when defining void main().
Sound a little bit mysterious :-)
MS>> why not? exit is a perfectly defined CRT functions which
MS>> can be used at
Sound a little bit 'professional' :-)
TS> This is semantically nonsense. Calling exit() means leaving
TS> the program, sending the argument of exit() as return code
TS> to the calling process.
Yes! Normally CMD.EXE !
TS> The compiler might have generated
TS> stupid code because of void main() which negates that
TS> scheme.
OK! YOU have experiences by experiments and Mario has experiences by
reading documentation :-)
TS> It is _bad_ _Bad_ _BAD_ _B_A_D_ to use void main().
If somebode DECLARES main() as void AND has decided to return a
ErrorLevelValue to caller he MUST use exit() ...
But you are right, a number of C-compilers generate STUPID code (mainly
Borland C for OS/2, which will TRAP in certain condition doing an exit()
from void main())
The source of MISTAKES (or supid code) is the HEAP-Checking which takes
place in exit() (or _exit()). Ununderstandable for me, but 'startupcode'
which is everytimes linked to c prog. will call some memoryallocation,
which seems to be NOT in congrouence (?) with 'exit()'.
I am thinking, it is BETTER to define ANYRESULT main(), and use either
explicit return(exit()) (from main) or use exit() only OUTSIDE from main()
(which will be normally accepted from Borland C) ...
Herzliche Gruesse, Harald
-+- Message created on Wednesday August, 28 1996 08:02:35 EDT
--- WarpEd/2 1.11à
* Origin: LFP Schwechat [OS/2] (2:310/14.59)SEEN-BY: 50/99 270/101 620/243 625/100 711/401 409 410 413 430 808 809 934 SEEN-BY: 711/955 712/407 515 624 628 713/888 800/1 @PATH: 310/14 1 24/999 888 396/1 270/101 712/515 711/808 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.