Date: Sun, 23 May 1999 20:01:08 -0400 Message-Id: <199905240001.UAA13489@envy.delorie.com> From: DJ Delorie To: djgpp AT delorie DOT com In-reply-to: <37497c89.11751624@noticias.iies.es> (XXguille@XXiies.XXes) Subject: Re: STL References: <373B3FD7 DOT 7D692AD2 AT alphalink DOT com DOT au> <373E8A8C DOT 87D93E54 AT earthlink DOT net> <37412752 DOT 914433 AT noticias DOT iies DOT es> <7hpdo5$m6k$1 AT news DOT doit DOT wisc DOT edu> <37497c89 DOT 11751624 AT noticias DOT iies DOT es> Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > After some discussion in es.lenguajes.c and es.lenguajes.c++ (spanish > newsgroup discussing c and c++ languajes), many people say that > according to the ISO standard, void main() is not incorrect, but > implementation dependent. That is, it is not portable, yet it is > allowed by the standard if the compiler chooses to support it. > > What do you think? DJGPP's runtime code will *use* the return value of main(), so it had better return one. If it is "implementation defined", then for the djgpp implementation, I define it as returning "int", even if gcc allows otherwise. My reference says that main returns "int" but if the *value* is undefined (i.e. it falls off the end of main without an explicit return), the value that is chosen as the return value is implementation-dependent.