Article View: comp.sys.amiga.tech
Article #11671Re: Any good makes out there?
From: James Crotinger
Date: Sun, 26 Feb 1989 02:22
Date: Sun, 26 Feb 1989 02:22
35 lines
1865 bytes
1865 bytes
In article <5963@cbmvax.UUCP>, jesup@cbmvax.UUCP (Randell Jesup) writes:
>
> That habit is the ANSI standard. main() is void.
>
I've seen three books which clearly state that main() returns type int.
K&R v2.0 has numerous examples which "return" from main, and state on
p. 26 that "Since main is a function like any other, it may return a value
to its caller, which is in effect the environment in which the program
was executed. Typically, a return value of zero implies normal termination;
non-zero values signal unusual or erroneous termination conditions."
Jaeschke, in "Portability and the C Language" states that "The method
used to invoke main during program startup can vary. ANSI C requires that
it be done as if the following code were used:
exit(main(argc,argv)) ;
in which case, any value returned explicitly or implicitly from main will
be passed on as the program's exit code." (p. 25)
Similarly, Harbison & Steel, 2nd Ed. state that main() should return
type int.
It seems to me that Lattice is in error on this point.
> --
> Randell Jesup, Commodore Engineering {uunet|rutgers|allegra}!cbmvax!jesup
Jim
--
Jim Crotinger
crotinger%mit.mfenet@nmfecc.arpa
Technical Details
Message-ID:
<100@ssibbs.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bionet!agate!ucbvax!ucsd!sdcsvax!ucsdhub!hp-sdd!hplabs!hpda!hpwala!cfisun!ima!mirror!ssi3b1!ssibbs!jacReferences:
<8902100715.AA16566@postgres.Berkeley.EDU> <5963@cbmvax.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bionet!agate!ucbvax!ucsd!sdcsvax!ucsdhub!hp-sdd!hplabs!hpda!hpwala!cfisun!ima!mirror!ssi3b1!ssibbs!jac From: jac@ssibbs.UUCP (James Crotinger) Newsgroups: comp.sys.amiga.tech Subject: Re: Any good makes out there? Summary: main is int, isint it? Message-ID: <100@ssibbs.UUCP> Date: 26 Feb 89 02:22:06 GMT References: <8902100715.AA16566@postgres.Berkeley.EDU> <5963@cbmvax.UUCP> Organization: Sangho's Public Access Unix, Cambridge, MA Lines: 35