[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [Qemu-devel] [PATCH 00/26] trivial: use exit(EXIT_SUC

From: Peter Maydell
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH 00/26] trivial: use exit(EXIT_SUCCESS) and exit(EXIT_FAILURE)
Date: Mon, 19 Sep 2016 11:19:10 +0100

On 19 September 2016 at 10:46, Laurent Vivier <address@hidden> wrote:
> -----------------------------------------------------------------------
> Portability note: Some non-POSIX systems use different conventions for
> exit status values. For greater portability, you can use the macros
> EXIT_SUCCESS and EXIT_FAILURE for the conventional status value for
> success and failure, respectively. They are declared in the file stdlib.h.

The only non-POSIX system we support is mingw32, which also uses 0/1
for its exit codes.

The POSIX rationale for exit() also notes that EXIT_SUCCESS is
required to be 0.

Personally I think we should:
 * definitely fix the "exit(-1)" and other exit-with-negative-number
   bugs in the codebase
 * possibly add a checkpatch check for exit-with-negative-constant-arg

If we're going to do anything else then maybe we could change
the EXIT_SUCCESS/EXIT_FAILURE instances in the codebase, but
really I think there are more important inconsistencies to
address (like all the unconverted non-QOM devices).

-- PMM

reply via email to

[Prev in Thread] Current Thread [Next in Thread]