delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/24/08:02:12

Date: Thu, 24 Jun 1999 12:16:53 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: I1269U <i1269u AT my-deja DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Exit codes?
In-Reply-To: <7ks25v$o7s$1@nnrp1.deja.com>
Message-ID: <Pine.SUN.3.91.990624121626.25071S-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Thu, 24 Jun 1999, I1269U wrote:

> I've had this annoying thing happening that I'm not really sure about.
> You know how djgpp displays the exit code upon program termination
> (when running it from within DJGPP that is)?

This is a misunderstanding: DJGPP programs don't display the exit code
upon termination.  You are probably using RHIDE and running your
programs from within the editor.  RHIDE indeed displays the exit code
of the programs it runs (as do several other programmer's editors).

> Well, no other compiler
> that I've used has done that, and I often see exit codes other than 0
> pop up.

Probably because your `main' function either wasn't declared as 
"int main", or because it didn't bother to return a specific value
with a "return" statement.  In that case, its exit code will have a
random value.  Using -Wall switch while compiling would cause the
compiler emit diagnostics for these gotchas.

See section 22.24 of the DJGPP FAQ list, for more info about declaring
`main'.

> I just want info on the exit codes, and
> if exit code 0x000a is something that would be specific to my code for
> some reason, just let me know and point to where I can get info on what
> it might mean on my own.

There's nothing special about the codes, they are not generated by
DJGPP.  It is up to your programs to assign meaning to the exit code
and return the correct values from the `main' function.  DJGPP itself
has nothing to do with that.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019