[GRASS-dev] adding lib_arraystats

Glynn Clements glynn at gclements.plus.com
Thu Feb 14 17:24:48 EST 2008


Moritz Lennert wrote:

> >> EXIT_SUCCESS used as a function exit status looks a bit strange to me too- 
> >> IIUC this is defined in stdlib.h and intended for programs to return a 
> >> status code to the enviroment when they exit, not really for internal use 
> >> by functions.
> 
> 
> Thanks to both of you for all your remarks, I'll try to rewrite the code 
> accordingly.
> 
> Concerning EXIT_SUCCESS, I based this on the SUBMITTING file which says:
> 
> 8.  Exit status is defined as EXIT_SUCCESS or EXIT_FAILURE, e.g.
> 
>      {
>        ...
>        if (G_parser (argc, argv))
>            exit (EXIT_FAILURE);
> 
>        ...
>        exit (EXIT_SUCCESS);
>      }
> 
> I guess this should read "Module exit status..." (i.e. not function exit 
> status) ?

I wouldn't have thought so, but as it has bitten at least one person,
maybe it should.

"exit status" means what programs return via exit() or by returning
from main().

Functions don't "exit" with an "exit status", they "return" with a
"return value".

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list