PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.cplus > exit codes
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
exit codes

Réponse
 
LinkBack Outils de la discussion
Vieux 13/11/2008, 09h11   #1
Gégé
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut exit codes

Hi all,

I'd like to know the meaning of this exit code :
( c++ program compiled with vc++)

"Exit Code -1073741819."

Is there a table for exit codes ?

Thanks
G
  Réponse avec citation
Vieux 13/11/2008, 10h16   #2
Tim Love
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: exit codes

=?ISO-8859-1?B?R+ln6Q==?= <valasg@gmail.com> writes:

>Hi all,


>I'd like to know the meaning of this exit code :
>( c++ program compiled with vc++)


>"Exit Code -1073741819."


>Is there a table for exit codes ?


Sometimes - sysexits.h is on some systems for example, and <stdlib> should,
I think, have a little table - but it might be better to look at the
program's doc and source.

  Réponse avec citation
Vieux 13/11/2008, 10h26   #3
James Kanze
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: exit codes

On Nov 13, 9:11 am, Gégé <val...@gmail.com> wrote:
> I'd like to know the meaning of this exit code :
> ( c++ program compiled with vc++)


> "Exit Code -1073741819."


The conventions depend on the system, and the actual exit code
depends on the program which exited. All the standard says is
that 0 and EXIT_SUCCESS will map to something the system will
understand as success, and that EXIT_FAILURE will map to
something the system understands as failure. Most systems have
more complete conventions, however, some of which may require
actual mapping. (On at least one system, even codes meant
failure, and odd success---the C/C++ runtime library had to map
0 to some other odd number.)

As a simply example, the Unix conventions are that if the value
returned by the application (when returning from main, or
calling exit) is 0, modulo 256, it is success, and all other
values are failure. But that convention is not universally used
by all Unix applications: grep, for example, will return 1 if
there is no match, and 2 for failure. (Depending on what you
are doing, no match may or may not be considered a failure).
And if the program is terminated by a signal (segment violation,
for example), the shell will simulate an exit code of the signal
number + 128 (which means that well behaved applications will
not return exit codes greater than 127).

I'm far less familiar with Windows, but I think it returns the
value without mapping (as opposed to the modulo 256 which Unix
uses); I'm also unsure of what it does if the process was
terminated. There's also a possibility that the program was
generated with a pre-standard compiler, and simply fell off the
end of main, effectively generating a random exit code. (The
C++ standard requires an exit code of 0 in such cases, but C
doesn't, and pre-standard C++ compilers likely won't guarantee 0
either.)

> Is there a table for exit codes ?


There should be one in the documentation of the program which
generated it. You might want to check out the system
documentation as well, in order to know what the general
conventions are.

--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
  Réponse avec citation
Vieux 13/11/2008, 11h11   #4
Rolf Magnus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: exit codes

James Kanze wrote:

> I'm far less familiar with Windows, but I think it returns the
> value without mapping (as opposed to the modulo 256 which Unix
> uses); I'm also unsure of what it does if the process was
> terminated. There's also a possibility that the program was
> generated with a pre-standard compiler, and simply fell off the
> end of main, effectively generating a random exit code. (The
> C++ standard requires an exit code of 0 in such cases, but C
> doesn't, and pre-standard C++ compilers likely won't guarantee 0
> either.)


Well, that is - if main's return type was int. I'm not sure what compilers
do if you define it (illegally) as void. Most compilers do allow it, but I
don't know what return value you'll get in such a case.

  Réponse avec citation
Vieux 13/11/2008, 23h08   #5
Gégé
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: exit codes

Hi all

This error was due to a recursive function that reached the recursion
threshold.
I changed my function to an iterative one, now it works fine.

Thank you all for your comments

Regards
G
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 09h27.


Édité par : vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,33702 seconds with 13 queries