🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #11445

Re: Any good makes out there?

#11445
From: Mike (I'll think of something ye...
Date: Tue, 14 Feb 1989 05:28
76 lines
3851 bytes
In article <5963@cbmvax.UUCP> jesup@cbmvax.UUCP (Randell Jesup) writes:
<In article <20212@agate.BERKELEY.EDU> mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer) writes:
<><Lattice 5.0 sets the exit code properly.  This seems to have been added
<><when they added all the support for standard 1.3 resident programs--when
<><compatibility with the standards started becoming more important, as
<><Jimm pointed out.
<>
<>The compiler may, but lc/lc1/lc2 don't. They always return 0 for
<>IoError. Makes using execute in Make or (a cc command) pretty
<>pointless - which is why I don't.
<
<	Huh?  lc/lc1/lc2 don't have to set IoErr().  They just have to
<return a non-0 return code.  There was one beta 5.0 that never returned error
<codes, you wouldn't be using it, would you?

I never had the beta Lattice Compiler. IoErr() is supposed to give you
the DOS return code from the command Execute ran ("further
information"). I wasn't getting those from IoErr() until after I ran
Bill Hawes PatchDOS program, which plugs in his version of Execute.
Could it be that Execute is throwing away that information?

<>That message _isn't_ from Make; it's from Execute(). For a make, I
<>don't want to see that message. Worse yet, you can't get the dos error
<>code from IoErr for lc (though real dos commands give it to you),
<>and Execute always hands back a -1 - no matter how well the command
<>works.
<
<	Execute() never prints such a message.


Ok, when _my_ code isn't printing that message, then who is?
It could be the Lattice Execute() stub. Given the context of the
comment (discussing using Execute() in Lattice C), this means
Execute() said it.

<Execute returns DOS_TRUE if
<the command was executed (== -1), or 0 if it couldn't execute it (usually
<because it couldn't load it).  LC has NO requirement to set IoErr to the
<value of an error IT got while doing an operation, all it has to do is return
<a non-0 return code.

Quite correct. But what becomes of the value returned by LC (or
ehatever?). My understanding was that it became available via IoErr().
This may be an extension Bill Hawes put into his code. In which case,
stock Execute is worthless for things like make (the original question
was "is there a make that uses Execute()?"). And of course LC doesn't
have to set IoErr - I didn't say it did. I said it "returned 0 for
IoErr." I left of the ()'s, but that was in reply to a comment that
there return value could be gotten via IoErr(). So either 1) they
always return 0, or 2) that value is thrown away. I (naively,
apparently) assumed that Lattice was more likely to be at fault than
CBM.

<>Finally, Lattice has the obnoxious habit of throwing away the value
<>returned from main.
<
<	That habit is the ANSI standard.  main() is void.

Section 2.1.2.2:

	int main(void) { /*...*/ }
	int main(int argc, char *argv[]) { /*...*/ }

and

	A return from the initial call to the main function is
	equivalent to calling the exit function with the value
	returned by the main function, ...

	<mike

--
I know the world is flat.				Mike Meyer
Don't try tell me that it's round.			mwm@berkeley.edu
I know the world stands still.				ucbvax!mwm
Don't try to make it turn around.			mwm@ucbjade.BITNET
Technical Details
Message-ID: <20353@agate.BERKELEY.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bionet!agate!eris.berkeley.edu!mwm
References: <8902100715.AA16566@postgres.Berkeley.EDU> <7381@batcomputer.tn.cornell.edu> <20212@agate.BERKELEY.EDU> <5963@cbmvax.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bionet!agate!eris.berkeley.edu!mwm
From: mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Any good makes out there?
Message-ID: <20353@agate.BERKELEY.EDU>
Date: 14 Feb 89 05:28:13 GMT
References: <8902100715.AA16566@postgres.Berkeley.EDU> <7381@batcomputer.tn.cornell.edu> <20212@agate.BERKELEY.EDU> <5963@cbmvax.UUCP>
Sender: usenet@agate.BERKELEY.EDU
Organization: Missionaria Phonibalonica
Lines: 76