TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Mike Ruskai
from: Rob Landley
date: 1995-04-22 10:29:26
subject: EMX main()

> Does anyone know why the EMX compiler insists that the main function has to 
> return an integer?  It won't accept void as the return type.

gcc is always like that, and in fact the main() function SHOULD return an
integer.  That's the error level returned to the calling program.

I first ran into this using gcc under unix.  Just declare it int main() and
return 0 as the last line of main.  Borland C++ is non-standard in that it
allows you to declare void main() in which case the error level returned to
dos is UNDEFINED!

Rob
 
--- Xblat
* Origin: The Conversation Pit, Marlton NJ 609-985-7553 OS/2 V34 (1:266/30)
SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 628 704 713/888 800/1 7877/2809
@PATH: 266/30 40 100 505 3615/50 396/1 270/101 105/103 42 712/515 711/808 809
@PATH: 711/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™.