Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Compilation problems??

Re: Compilation problems??

From: Alicia Carla Longstreet <carla_at_ici.net>
Date: 1997/08/14
Message-ID: <33F39B9C.5E4C@ici.net>#1/1

Chris Engebretson wrote:
>
> In article <33F359DD.4855_at_ici.net>, Alicia Carla Longstreet <carla_at_ici.net> writes:
>
> |> There is NOTHING in the standard that requires a program to return
> |> either EXIT_SUCCESS or EXIT_FAILURE, the Standard allows ANY INTEGER
> |> VALUE to be returned, with either exit() or a simple return.
>
> However a program which exits with a status other than 0, EXIT_SUCCESS,
> or EXIT_FAILURE is not a strictly-conforming C program. The behavior
> of exit statuses not mentioned above is implementation-defined, i.e,
> on one platform "exit(1);" might indicate success, on another it might
> indicate failure, and on yet another it might even indicate that the
> program "almost worked."

Which is patently absurd. When I write a program, I, not the standard, not you or anybody else, decide what the exit codes mean. Exit codes often specify what went wrong, or possibly, most any exit code is a code for sucess. The Standard defines three exit codes to be used when the programmer has no desire or need to provide exit codes of his/her own specification.

Exit codes are NEVER implementation defined, they are ALWAYS defined by the programmer and should be specified in the documentation.

If I write a program and decide that exit(99) indicates failure due to an inability to allocate sufficient memory for a data object, that is EXACTLY what an exit code of 99 will mean ON EVERY SINGLE PLATFORM/OS THAT I CHOOSE TO PORT MY PROGRAM TO.

-- 
*********************************************************
* Alicia Carla Longstreet     carla_at_ici.net             *
* Supporter of the campaign against grumpiness on c.l.c *
*********************************************************
*      Children,                                        *
*      We spend two years teaching them to talk...      *
*      and 20 years trying to get them to shut up!      *
*********************************************************
The money spent on an abortion,
as any woman may find out,
can better be spent on other things,
like taking the kids to an amusment park, or on vacation.
Received on Thu Aug 14 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US