Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

If God is perfect, why did He create discontinuous functions?


devel / comp.lang.fortran / Re: Reliably exiting with non-zero condition code

SubjectAuthor
* Reliably exiting with non-zero condition codeThomas Koenig
+* Re: Reliably exiting with non-zero condition codeSteven G. Kargl
|`* Re: Reliably exiting with non-zero condition codeThomas Koenig
| +* Re: Reliably exiting with non-zero condition codetTh
| |`- Re: Reliably exiting with non-zero condition codeThomas Koenig
| `- Re: Reliably exiting with non-zero condition codeSteven G. Kargl
+* Re: Reliably exiting with non-zero condition codegah4
|`* Re: Reliably exiting with non-zero condition codePhillip Helbig (undress to reply
| `- Re: Reliably exiting with non-zero condition codeThomas Koenig
+- Re: Reliably exiting with non-zero condition codegah4
`* Re: Reliably exiting with non-zero condition codeSteve Lionel
 `* Re: Reliably exiting with non-zero condition codegah4
  +* Re: Reliably exiting with non-zero condition codejfh
  |`- Re: Reliably exiting with non-zero condition codeThomas Koenig
  `- Re: Reliably exiting with non-zero condition codeSteve Lionel

1
Reliably exiting with non-zero condition code

<tbs56n$jtg$1@newsreader4.netcologne.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2640&group=comp.lang.fortran#2640

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-dd1e-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.lang.fortran
Subject: Reliably exiting with non-zero condition code
Date: Wed, 27 Jul 2022 19:55:03 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <tbs56n$jtg$1@newsreader4.netcologne.de>
Injection-Date: Wed, 27 Jul 2022 19:55:03 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-dd1e-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:dd1e:0:7285:c2ff:fe6c:992d";
logging-data="20400"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Wed, 27 Jul 2022 19:55 UTC

Hi,

for a testsuite, I want to make sure that a program returns
a non-zero status in case of an error. This should be as
compiler-independent as possible, I am trying to avoid
run-time tests while testing different possibilities.
So, what can be tested?

Any reasonably modern compiler will have ERROR STOP, and
I expect that to set a non-zero condition code.

If that is not available, next I would try if the program

intrinsic abort
call abort
end

If that compiles, a call to abort should work at run-time.

I'm not sure that

stop 1
end

works in all cases, I would probably try that last.

Any others? Maybe read from an un-opened file? :-)

Re: Reliably exiting with non-zero condition code

<tbs99v$2khi2$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2641&group=comp.lang.fortran#2641

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: sgk@REMOVEtroutmask.apl.washington.edu (Steven G. Kargl)
Newsgroups: comp.lang.fortran
Subject: Re: Reliably exiting with non-zero condition code
Date: Wed, 27 Jul 2022 21:05:03 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <tbs99v$2khi2$1@dont-email.me>
References: <tbs56n$jtg$1@newsreader4.netcologne.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 27 Jul 2022 21:05:03 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="70eab117cc367e97ab12a1774e1ee52a";
logging-data="2770498"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+TbqNoqfgn+jZpcteco9j4"
User-Agent: Pan/0.145 (Duplicitous mercenary valetism; d7e168a
git.gnome.org/pan2)
Cancel-Lock: sha1:SdtAoE7STI76OrbURaGnEISgqTM=
 by: Steven G. Kargl - Wed, 27 Jul 2022 21:05 UTC

On Wed, 27 Jul 2022 19:55:03 +0000, Thomas Koenig wrote:

> Any others? Maybe read from an un-opened file? :-)

Modern compilers have a companion C processor.
abort() is part of the standard C library. The
prototype is "void abort(void)", so

interface
subroutine abort() bind(c, name="abort")
end subroutine
end interface

call abort

end

--
steve

Re: Reliably exiting with non-zero condition code

<eef02eea-cb4e-4e92-b1b3-b8bb27bb6163n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2642&group=comp.lang.fortran#2642

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ac8:5cc3:0:b0:31f:782:8588 with SMTP id s3-20020ac85cc3000000b0031f07828588mr20861572qta.594.1658958499119;
Wed, 27 Jul 2022 14:48:19 -0700 (PDT)
X-Received: by 2002:a05:6902:118a:b0:66f:774d:dbf5 with SMTP id
m10-20020a056902118a00b0066f774ddbf5mr19692074ybu.532.1658958498985; Wed, 27
Jul 2022 14:48:18 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 27 Jul 2022 14:48:18 -0700 (PDT)
In-Reply-To: <tbs56n$jtg$1@newsreader4.netcologne.de>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:bc00:4a16:395a:7895;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:bc00:4a16:395a:7895
References: <tbs56n$jtg$1@newsreader4.netcologne.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <eef02eea-cb4e-4e92-b1b3-b8bb27bb6163n@googlegroups.com>
Subject: Re: Reliably exiting with non-zero condition code
From: gah4@u.washington.edu (gah4)
Injection-Date: Wed, 27 Jul 2022 21:48:19 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2144
 by: gah4 - Wed, 27 Jul 2022 21:48 UTC

On Wednesday, July 27, 2022 at 12:55:56 PM UTC-7, Thomas Koenig wrote:

> for a testsuite, I want to make sure that a program returns
> a non-zero status in case of an error. This should be as
> compiler-independent as possible, I am trying to avoid
> run-time tests while testing different possibilities.

(snip)

> I'm not sure that
>
> stop 1

As far as I know, all systems that have a return code, use the
number from STOP. I don't know that all OS have one, but
the usual ones do.

IBM tradition is to use return codes that are multiples of four.
Usual compiler return codes are 4 for warning, 8 for error, and
sometimes 12 for severe error.

Many years ago, I had a program that ends with STOP 8.

Running it on VMS, I believe VAX/VMS, as that was before Alpha,
VMS prints out the message in a table at position 8, which if I
find it right from a web search is "ACCVIO, Access Violation".

Took me a while to figure out that meant 8.

Re: Reliably exiting with non-zero condition code

<tbt83q$huk$1@newsreader4.netcologne.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2643&group=comp.lang.fortran#2643

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-dd1e-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.lang.fortran
Subject: Re: Reliably exiting with non-zero condition code
Date: Thu, 28 Jul 2022 05:50:50 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <tbt83q$huk$1@newsreader4.netcologne.de>
References: <tbs56n$jtg$1@newsreader4.netcologne.de>
<tbs99v$2khi2$1@dont-email.me>
Injection-Date: Thu, 28 Jul 2022 05:50:50 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-dd1e-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:dd1e:0:7285:c2ff:fe6c:992d";
logging-data="18388"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Thu, 28 Jul 2022 05:50 UTC

Hi Steve,

> On Wed, 27 Jul 2022 19:55:03 +0000, Thomas Koenig wrote:
>
>> Any others? Maybe read from an un-opened file? :-)
>
> Modern compilers have a companion C processor.
> abort() is part of the standard C library. The
> prototype is "void abort(void)", so
>
>
> interface
> subroutine abort() bind(c, name="abort")
> end subroutine
> end interface
>
> call abort
>
> end

You're right that this will produce a non-zero return code in
all cases. However, it might also produce a core dump (filling
up /var/crash on some Ubuntu systems, for example - not that I
agree with that design decision), which is not something I'd
like for a testsuite.

Re: Reliably exiting with non-zero condition code

<tbt8ii$1o49$1@news.gegeweb.eu>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2644&group=comp.lang.fortran#2644

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!news.nntp4.net!news.gegeweb.eu!gegeweb.org!.POSTED.2001:861:5e50:f690:4c09:46bf:dc58:8c24!not-for-mail
From: tth@none.invalid (tTh)
Newsgroups: comp.lang.fortran
Subject: Re: Reliably exiting with non-zero condition code
Date: Thu, 28 Jul 2022 07:58:42 +0200
Organization: Gegeweb News Server
Message-ID: <tbt8ii$1o49$1@news.gegeweb.eu>
References: <tbs56n$jtg$1@newsreader4.netcologne.de>
<tbs99v$2khi2$1@dont-email.me> <tbt83q$huk$1@newsreader4.netcologne.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 28 Jul 2022 05:58:42 -0000 (UTC)
Injection-Info: news.gegeweb.eu; posting-account="tontonth@usenet.local"; posting-host="2001:861:5e50:f690:4c09:46bf:dc58:8c24";
logging-data="57481"; mail-complaints-to="abuse@gegeweb.eu"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Thunderbird/91.11.0
Cancel-Lock: sha256:Xy5sbwgG5cX2P9rEhHfJbSrxABXcFbLV6GiO7SLYAgA=
In-Reply-To: <tbt83q$huk$1@newsreader4.netcologne.de>
Content-Language: en-US
 by: tTh - Thu, 28 Jul 2022 05:58 UTC

On 7/28/22 07:50, Thomas Koenig wrote:
>>
>> interface
>> subroutine abort() bind(c, name="abort")
>> end subroutine
>> end interface
>>
>> call abort
>>
>> end
>
> You're right that this will produce a non-zero return code in
> all cases. However, it might also produce a core dump (filling
> up /var/crash on some Ubuntu systems, for example - not that I
> agree with that design decision), which is not something I'd
> like for a testsuite.

$ ulimit -c 0
$ ./run_my_job

--
+------------------------------------------------------------------+
| https://framalibre.org/content/tetalab |
+------------------------------------------------------------------+

Re: Reliably exiting with non-zero condition code

<tbtvn1$675$1@gioia.aioe.org>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2645&group=comp.lang.fortran#2645

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!aioe.org!PshLQGAcJQdn1gtm+Q+5Jg.user.46.165.242.75.POSTED!not-for-mail
From: helbig@asclothestro.multivax.de (Phillip Helbig (undress to reply)
Newsgroups: comp.lang.fortran
Subject: Re: Reliably exiting with non-zero condition code
Date: Thu, 28 Jul 2022 12:33:37 -0000 (UTC)
Organization: Multivax C&R
Message-ID: <tbtvn1$675$1@gioia.aioe.org>
References: <tbs56n$jtg$1@newsreader4.netcologne.de> <eef02eea-cb4e-4e92-b1b3-b8bb27bb6163n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="6373"; posting-host="PshLQGAcJQdn1gtm+Q+5Jg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: Phillip Helbig (undr - Thu, 28 Jul 2022 12:33 UTC

In article <eef02eea-cb4e-4e92-b1b3-b8bb27bb6163n@googlegroups.com>,
gah4 <gah4@u.washington.edu> writes:

> IBM tradition is to use return codes that are multiples of four.
> Usual compiler return codes are 4 for warning, 8 for error, and
> sometimes 12 for severe error.
>
> Many years ago, I had a program that ends with STOP 8.
>
> Running it on VMS, I believe VAX/VMS, as that was before Alpha,
> VMS prints out the message in a table at position 8, which if I
> find it right from a web search is "ACCVIO, Access Violation".
>
> Took me a while to figure out that meant 8.

Yes, the wonders of VMS:

$ exit 2928
%SYSTEM-W-FISH, my hovercraft is full of eels

Re: Reliably exiting with non-zero condition code

<tbua4s$35fkj$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2646&group=comp.lang.fortran#2646

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: sgk@REMOVEtroutmask.apl.washington.edu (Steven G. Kargl)
Newsgroups: comp.lang.fortran
Subject: Re: Reliably exiting with non-zero condition code
Date: Thu, 28 Jul 2022 15:31:40 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <tbua4s$35fkj$1@dont-email.me>
References: <tbs56n$jtg$1@newsreader4.netcologne.de>
<tbs99v$2khi2$1@dont-email.me> <tbt83q$huk$1@newsreader4.netcologne.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 28 Jul 2022 15:31:40 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="815c28f855e07d106f6c1ef653a9e757";
logging-data="3325587"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18279EVgcHBIdDapHbxkCUu"
User-Agent: Pan/0.145 (Duplicitous mercenary valetism; d7e168a
git.gnome.org/pan2)
Cancel-Lock: sha1:WUeK+d1gHdFSKG0NAp3yKjYYyd0=
 by: Steven G. Kargl - Thu, 28 Jul 2022 15:31 UTC

On Thu, 28 Jul 2022 05:50:50 +0000, Thomas Koenig wrote:

> Hi Steve,
>
>> On Wed, 27 Jul 2022 19:55:03 +0000, Thomas Koenig wrote:
>>
>>> Any others? Maybe read from an un-opened file? :-)
>>
>> Modern compilers have a companion C processor.
>> abort() is part of the standard C library. The
>> prototype is "void abort(void)", so
>>
>>
>> interface
>> subroutine abort() bind(c, name="abort")
>> end subroutine
>> end interface
>>
>> call abort
>>
>> end
>
> You're right that this will produce a non-zero return code in
> all cases. However, it might also produce a core dump (filling
> up /var/crash on some Ubuntu systems, for example - not that I
> agree with that design decision), which is not something I'd
> like for a testsuite.

Yep, I thought about that after I posted. It should be possible
to use exit(3).

use iso_c_binding, only : c_int
interface
subroutine exit(n) bind(c, name="exit")
import c_int
integer(c_int), value :: n
end subroutine exit
end interface

--
steve

Re: Reliably exiting with non-zero condition code

<tbuddj$htj$1@newsreader4.netcologne.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2647&group=comp.lang.fortran#2647

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-dd1e-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.lang.fortran
Subject: Re: Reliably exiting with non-zero condition code
Date: Thu, 28 Jul 2022 16:27:31 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <tbuddj$htj$1@newsreader4.netcologne.de>
References: <tbs56n$jtg$1@newsreader4.netcologne.de>
<eef02eea-cb4e-4e92-b1b3-b8bb27bb6163n@googlegroups.com>
<tbtvn1$675$1@gioia.aioe.org>
Injection-Date: Thu, 28 Jul 2022 16:27:31 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-dd1e-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:dd1e:0:7285:c2ff:fe6c:992d";
logging-data="18355"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Thu, 28 Jul 2022 16:27 UTC

Phillip Helbig (undress to reply) <helbig@asclothestro.multivax.de> schrieb:
> In article <eef02eea-cb4e-4e92-b1b3-b8bb27bb6163n@googlegroups.com>,
> gah4 <gah4@u.washington.edu> writes:
>
>> IBM tradition is to use return codes that are multiples of four.
>> Usual compiler return codes are 4 for warning, 8 for error, and
>> sometimes 12 for severe error.
>>
>> Many years ago, I had a program that ends with STOP 8.
>>
>> Running it on VMS, I believe VAX/VMS, as that was before Alpha,
>> VMS prints out the message in a table at position 8, which if I
>> find it right from a web search is "ACCVIO, Access Violation".
>>
>> Took me a while to figure out that meant 8.
>
> Yes, the wonders of VMS:
>
> $ exit 2928
> %SYSTEM-W-FISH, my hovercraft is full of eels

Ah, the Hungarian phrasebook with intent to breach
the peace.

Any special meaning to 2928?

Re: Reliably exiting with non-zero condition code

<7fbe59fd-c244-4154-9f8b-555a0b0ec435n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2648&group=comp.lang.fortran#2648

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:408c:b0:6b2:678c:6091 with SMTP id f12-20020a05620a408c00b006b2678c6091mr932135qko.518.1659049560743;
Thu, 28 Jul 2022 16:06:00 -0700 (PDT)
X-Received: by 2002:a05:6902:124e:b0:668:222c:e8da with SMTP id
t14-20020a056902124e00b00668222ce8damr687766ybu.383.1659049560587; Thu, 28
Jul 2022 16:06:00 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Thu, 28 Jul 2022 16:06:00 -0700 (PDT)
In-Reply-To: <tbs56n$jtg$1@newsreader4.netcologne.de>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:593c:9c39:6e3a:9fd1;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:593c:9c39:6e3a:9fd1
References: <tbs56n$jtg$1@newsreader4.netcologne.de>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7fbe59fd-c244-4154-9f8b-555a0b0ec435n@googlegroups.com>
Subject: Re: Reliably exiting with non-zero condition code
From: gah4@u.washington.edu (gah4)
Injection-Date: Thu, 28 Jul 2022 23:06:00 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2353
 by: gah4 - Thu, 28 Jul 2022 23:06 UTC

On Wednesday, July 27, 2022 at 12:55:56 PM UTC-7, Thomas Koenig wrote:
> Hi,
>
> for a testsuite, I want to make sure that a program returns
> a non-zero status in case of an error. This should be as
> compiler-independent as possible, I am trying to avoid
> run-time tests while testing different possibilities.

I haven't thought about this recently, but do all operating systems
(that are actually operating systems) have a return code?

IBM has had one at least since OS/360, where it is the low bits
of R15 when the program exits. I presume that DOS/360 and
its descendants also have one, and other later IBM OS.

Unix and unix-like system have one, usually set with the
C library exit() function, as noted. Are there any systems
with a Fortran compiler, but not a companion C compiler?

As noted VAX/VMS, and VMS descendants have one,
I am trying to remember other DEC OS, such as RT-11,
and TOPS-10.

I didn't use PC-DOS/MS-DOS back to 1.0, so I am not sure
about those. Definitely newer versions have one, and
Windows, too.

I don't know at all about others, like Primos for Prime,
RDOS for DataGeneral, or other non-Unix minicomputer
systems.

Re: Reliably exiting with non-zero condition code

<tbvqao$peq$1@newsreader4.netcologne.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2649&group=comp.lang.fortran#2649

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-dd1e-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.lang.fortran
Subject: Re: Reliably exiting with non-zero condition code
Date: Fri, 29 Jul 2022 05:14:00 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <tbvqao$peq$1@newsreader4.netcologne.de>
References: <tbs56n$jtg$1@newsreader4.netcologne.de>
<tbs99v$2khi2$1@dont-email.me> <tbt83q$huk$1@newsreader4.netcologne.de>
<tbt8ii$1o49$1@news.gegeweb.eu>
Injection-Date: Fri, 29 Jul 2022 05:14:00 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-dd1e-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:dd1e:0:7285:c2ff:fe6c:992d";
logging-data="26074"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Fri, 29 Jul 2022 05:14 UTC

tTh <tth@none.invalid> schrieb:
> On 7/28/22 07:50, Thomas Koenig wrote:
>>>
>>> interface
>>> subroutine abort() bind(c, name="abort")
>>> end subroutine
>>> end interface
>>>
>>> call abort
>>>
>>> end
>>
>> You're right that this will produce a non-zero return code in
>> all cases. However, it might also produce a core dump (filling
>> up /var/crash on some Ubuntu systems, for example - not that I
>> agree with that design decision), which is not something I'd
>> like for a testsuite.
>
> $ ulimit -c 0
> $ ./run_my_job

Not so easy to integrate into an existing testsuite framework,
unfortunately.
>

Re: Reliably exiting with non-zero condition code

<jkidklFo3fhU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2650&group=comp.lang.fortran#2650

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: steve@seesignature.invalid (Steve Lionel)
Newsgroups: comp.lang.fortran
Subject: Re: Reliably exiting with non-zero condition code
Date: Fri, 29 Jul 2022 11:45:25 -0400
Lines: 23
Message-ID: <jkidklFo3fhU1@mid.individual.net>
References: <tbs56n$jtg$1@newsreader4.netcologne.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net P/856Yt7RwzsLYFJENOnlA5ZK92E13tninHtq/VkpbD8JHOEaT
Cancel-Lock: sha1:jxUezqbz35LLK8WbYnk1wwN/2Wo=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101
Thunderbird/103.0
Content-Language: en-US
In-Reply-To: <tbs56n$jtg$1@newsreader4.netcologne.de>
 by: Steve Lionel - Fri, 29 Jul 2022 15:45 UTC

On 7/27/2022 3:55 PM, Thomas Koenig wrote:
> Any reasonably modern compiler will have ERROR STOP, and
> I expect that to set a non-zero condition code.

Note that the standard recommends, but does not require, a compiler to
set the program exit status based on the STOP code. The words are:

"If the stop-code is an integer, it is recommended that the value be
used as the process exit status, if the processor supports that concept."

The only requirement is that " its stop code, if any, is made available
in a processor-dependent manner."
--
Steve Lionel
ISO/IEC JTC1/SC22/WG5 (Fortran) Convenor
Retired Intel Fortran developer/support
Email: firstname at firstnamelastname dot com
Twitter: @DoctorFortran
LinkedIn: https://www.linkedin.com/in/stevelionel
Blog: https://stevelionel.com/drfortran
WG5: https://wg5-fortran.org

Re: Reliably exiting with non-zero condition code

<48b0cabb-b6bb-4d90-88da-13ee33fd696cn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2651&group=comp.lang.fortran#2651

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:6214:d0a:b0:474:6a19:28aa with SMTP id 10-20020a0562140d0a00b004746a1928aamr4895311qvh.81.1659128866691;
Fri, 29 Jul 2022 14:07:46 -0700 (PDT)
X-Received: by 2002:a81:8c3:0:b0:323:5563:97f4 with SMTP id
186-20020a8108c3000000b00323556397f4mr4405194ywi.289.1659128866433; Fri, 29
Jul 2022 14:07:46 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!peer03.ams4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Fri, 29 Jul 2022 14:07:46 -0700 (PDT)
In-Reply-To: <jkidklFo3fhU1@mid.individual.net>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:a56b:55b2:b2c9:d286;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:a56b:55b2:b2c9:d286
References: <tbs56n$jtg$1@newsreader4.netcologne.de> <jkidklFo3fhU1@mid.individual.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <48b0cabb-b6bb-4d90-88da-13ee33fd696cn@googlegroups.com>
Subject: Re: Reliably exiting with non-zero condition code
From: gah4@u.washington.edu (gah4)
Injection-Date: Fri, 29 Jul 2022 21:07:46 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2223
 by: gah4 - Fri, 29 Jul 2022 21:07 UTC

On Friday, July 29, 2022 at 8:45:30 AM UTC-7, Steve Lionel wrote:

(snip)
> Note that the standard recommends, but does not require, a compiler to
> set the program exit status based on the STOP code. The words are:
> "If the stop-code is an integer, it is recommended that the value be
> used as the process exit status, if the processor supports that concept."
> The only requirement is that " its stop code, if any, is made available
> in a processor-dependent manner."

As well as I know, it is not unusual to print out the value, if there is
a place to print it.

Some systems will print out the return code, or only print out
non-zero values, along with returning them where they go.

I was trying to think of any systems that don't have something like
a return code to return.

Do any systems have a return code, but don't allow one to use it?
That is for example, to do something conditional on the value?

Re: Reliably exiting with non-zero condition code

<c70bfe9c-1c59-4149-ae37-22ff589acfdfn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2652&group=comp.lang.fortran#2652

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:240b:b0:6b5:f9af:2412 with SMTP id d11-20020a05620a240b00b006b5f9af2412mr4251138qkn.457.1659129859727;
Fri, 29 Jul 2022 14:24:19 -0700 (PDT)
X-Received: by 2002:a81:f47:0:b0:31f:434b:5ee with SMTP id 68-20020a810f47000000b0031f434b05eemr4675575ywp.383.1659129859505;
Fri, 29 Jul 2022 14:24:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Fri, 29 Jul 2022 14:24:19 -0700 (PDT)
In-Reply-To: <48b0cabb-b6bb-4d90-88da-13ee33fd696cn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=115.189.131.46; posting-account=KnYfEgoAAAD1tUJTvdAUZ3XojNa5tezZ
NNTP-Posting-Host: 115.189.131.46
References: <tbs56n$jtg$1@newsreader4.netcologne.de> <jkidklFo3fhU1@mid.individual.net>
<48b0cabb-b6bb-4d90-88da-13ee33fd696cn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c70bfe9c-1c59-4149-ae37-22ff589acfdfn@googlegroups.com>
Subject: Re: Reliably exiting with non-zero condition code
From: harperjf2@gmail.com (jfh)
Injection-Date: Fri, 29 Jul 2022 21:24:19 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2455
 by: jfh - Fri, 29 Jul 2022 21:24 UTC

On Saturday, July 30, 2022 at 9:07:48 AM UTC+12, gah4 wrote:
> On Friday, July 29, 2022 at 8:45:30 AM UTC-7, Steve Lionel wrote:
>
> (snip)
> > Note that the standard recommends, but does not require, a compiler to
> > set the program exit status based on the STOP code. The words are:
>
> > "If the stop-code is an integer, it is recommended that the value be
> > used as the process exit status, if the processor supports that concept."
>
> > The only requirement is that " its stop code, if any, is made available
> > in a processor-dependent manner."
> As well as I know, it is not unusual to print out the value, if there is
> a place to print it.
>
> Some systems will print out the return code, or only print out
> non-zero values, along with returning them where they go.
>
> I was trying to think of any systems that don't have something like
> a return code to return.
>
> Do any systems have a return code, but don't allow one to use it?
> That is for example, to do something conditional on the value?

Some years ago I had access to NAG Fortran and was surprised to find that if one's stop code was an integer it was written out in octal not decimal. I don't know if NAG still does that.

Re: Reliably exiting with non-zero condition code

<tc1k11$c37$1@newsreader4.netcologne.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2653&group=comp.lang.fortran#2653

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.2001-4dd7-dd1e-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de!not-for-mail
From: tkoenig@netcologne.de (Thomas Koenig)
Newsgroups: comp.lang.fortran
Subject: Re: Reliably exiting with non-zero condition code
Date: Fri, 29 Jul 2022 21:38:41 -0000 (UTC)
Organization: news.netcologne.de
Distribution: world
Message-ID: <tc1k11$c37$1@newsreader4.netcologne.de>
References: <tbs56n$jtg$1@newsreader4.netcologne.de>
<jkidklFo3fhU1@mid.individual.net>
<48b0cabb-b6bb-4d90-88da-13ee33fd696cn@googlegroups.com>
<c70bfe9c-1c59-4149-ae37-22ff589acfdfn@googlegroups.com>
Injection-Date: Fri, 29 Jul 2022 21:38:41 -0000 (UTC)
Injection-Info: newsreader4.netcologne.de; posting-host="2001-4dd7-dd1e-0-7285-c2ff-fe6c-992d.ipv6dyn.netcologne.de:2001:4dd7:dd1e:0:7285:c2ff:fe6c:992d";
logging-data="12391"; mail-complaints-to="abuse@netcologne.de"
User-Agent: slrn/1.0.3 (Linux)
 by: Thomas Koenig - Fri, 29 Jul 2022 21:38 UTC

jfh <harperjf2@gmail.com> schrieb:
> On Saturday, July 30, 2022 at 9:07:48 AM UTC+12, gah4 wrote:
>> On Friday, July 29, 2022 at 8:45:30 AM UTC-7, Steve Lionel wrote:
>>
>> (snip)
>> > Note that the standard recommends, but does not require, a compiler to
>> > set the program exit status based on the STOP code. The words are:
>>
>> > "If the stop-code is an integer, it is recommended that the value be
>> > used as the process exit status, if the processor supports that concept."
>>
>> > The only requirement is that " its stop code, if any, is made available
>> > in a processor-dependent manner."
>> As well as I know, it is not unusual to print out the value, if there is
>> a place to print it.
>>
>> Some systems will print out the return code, or only print out
>> non-zero values, along with returning them where they go.
>>
>> I was trying to think of any systems that don't have something like
>> a return code to return.
>>
>> Do any systems have a return code, but don't allow one to use it?
>> That is for example, to do something conditional on the value?
>
> Some years ago I had access to NAG Fortran and was surprised to
> find that if one's stop code was an integer it was written out in
> octal not decimal. I don't know if NAG still does that.

Seems it does not:

$ cat stop.f90
stop 123
end
$ nagfor stop.f90
NAG Fortran Compiler Release 7.1(Hanzomon) Build 7101
[NAG Fortran Compiler normal termination]
$ ./a.out || echo $?
STOP: 123
123
$

Re: Reliably exiting with non-zero condition code

<jklk2fF6fimU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=2654&group=comp.lang.fortran#2654

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: steve@seesignature.invalid (Steve Lionel)
Newsgroups: comp.lang.fortran
Subject: Re: Reliably exiting with non-zero condition code
Date: Sat, 30 Jul 2022 16:53:34 -0400
Lines: 16
Message-ID: <jklk2fF6fimU1@mid.individual.net>
References: <tbs56n$jtg$1@newsreader4.netcologne.de>
<jkidklFo3fhU1@mid.individual.net>
<48b0cabb-b6bb-4d90-88da-13ee33fd696cn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net g9Ck7Rbmu9AQ9tO5jyJ42Qa5KgO9ZUHbg8tGuUjf7deGaCw1cl
Cancel-Lock: sha1:8awe2oiogun7N1nscQdkThD/Gi4=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101
Thunderbird/103.0
Content-Language: en-US
In-Reply-To: <48b0cabb-b6bb-4d90-88da-13ee33fd696cn@googlegroups.com>
 by: Steve Lionel - Sat, 30 Jul 2022 20:53 UTC

On 7/29/2022 5:07 PM, gah4 wrote:
> As well as I know, it is not unusual to print out the value, if there is
> a place to print it.

This is why we added the QUIET= option to STOP and ERROR STOP.
--
Steve Lionel
ISO/IEC JTC1/SC22/WG5 (Fortran) Convenor
Retired Intel Fortran developer/support
Email: firstname at firstnamelastname dot com
Twitter: @DoctorFortran
LinkedIn: https://www.linkedin.com/in/stevelionel
Blog: https://stevelionel.com/drfortran
WG5: https://wg5-fortran.org

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor