On Thu, Oct 31, 2019 at 10:04 PM Steve Kargl
<s...@troutmask.apl.washington.edu> wrote:
>
> On Thu, Oct 31, 2019 at 09:30:26PM +0200, Janne Blomqvist wrote:
> >
> > I'd personally prefer the current behavior. I.e. just let the
> > underlying OS/libc handle it as it sees fit. No need to invent our own
> > semantics here. Tobias quoted the relevant part of the standard, which
> > the current implementation fulfills just fine.
> >
>
> I'm fine with that.  I suppose someone should
> document how gfortran communicates an exit
> status to an invoking shell handle; especially
> when the stop codes exceeds 255.

In principle yes, but how to do it without bogging down into minutiae
of how different targets allow retrieving the process exit status?

For POSIX, we can say that the 8 lowest order bits are used.  Except
if using the POSIX 2008 waitid() function which allows the parent
process to retrieve the full 32 bits. And Windows apparently use
32-bit unsigned integers. And then all the weird targets that a
handful of people around the world for some reason care about, etc.

More info at wikipedia: https://en.wikipedia.org/wiki/Exit_status

Perhaps some note that positive integers in the range [0,255] are
somewhat portable?

-- 
Janne Blomqvist

Reply via email to