Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

It is now pitch dark. If you proceed, you will likely fall into a pit.


devel / comp.lang.fortran / Am I just up too late?

SubjectAuthor
* Am I just up too late?James Van Buskirk
+- Re: Am I just up too late?gah4
+- Re: Am I just up too late?FortranFan
+* Re: Am I just up too late?Steve Lionel
|+* Re: Am I just up too late?Steve Lionel
||`* Re: Am I just up too late?FortranFan
|| `- Re: Am I just up too late?Steve Lionel
|`- Re: Am I just up too late?James Van Buskirk
+* Re: Am I just up too late?Peter Klausler US
|+- Re: Am I just up too late?Neil
|`* Re: Am I just up too late?Robin Vowels
| `- Re: Am I just up too late?James Van Buskirk
+* Re: Am I just up too late?gah4
|+* Re: Am I just up too late?John
||+- Re: Am I just up too late?gah4
||`- Re: Am I just up too late?James Van Buskirk
|`* Re: Am I just up too late?Steve Lionel
| `* Re: Am I just up too late?gah4
|  `- Re: Am I just up too late?Steve Lionel
+- Re: Am I just up too late?gah4
`- Re: Am I just up too late?Robin Vowels

1
Am I just up too late?

<tkiiid$hf4h$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: not_valid@comcast.net (James Van Buskirk)
Newsgroups: comp.lang.fortran
Subject: Am I just up too late?
Date: Thu, 10 Nov 2022 03:07:28 -0700
Organization: A noiseless patient Spider
Lines: 1
Message-ID: <tkiiid$hf4h$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain;
format=flowed;
charset="iso-8859-1";
reply-type=original
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 10 Nov 2022 10:08:13 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="70cde3e345a98f7da8a30f1e1b33886a";
logging-data="572561"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/MIFLBtNofAzLMVkNXHP6YG24Na7KQsJk="
Cancel-Lock: sha1:UTlfi+H8VJFlzUx1YadWaVz3Lyk=
X-Newsreader: Microsoft Windows Live Mail 16.4.3528.331
X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331
X-MSMail-Priority: Normal
X-Priority: 3
Importance: Normal
 by: James Van Buskirk - Thu, 10 Nov 2022 10:07 UTC

This seemed kind of weird to me. Am I just up too late?

D:\gfortran\james>type bug5.f90
recursive function bug5(x)
implicit none
character(*), intent(in) :: x
character(:), allocatable :: bug5
bug5 = x
if(bug5(1:1) == 'Z') bug5 = '_'//bug5
end function bug5

D:\gfortran\james>ifort /c bug5.f90
Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on
Inte
l(R) 64, Version 15.0.2.179 Build 20150121
Copyright (C) 1985-2015 Intel Corporation. All rights reserved.

D:\gfortran\james>gfortran -c bug5.f90
bug5.f90:6:11:

6 | if(bug5(1:1) == 'Z') bug5 = '_'//bug5
| 1
Error: 'bug5' at (1) is the name of a recursive function and so refers to
the re
sult variable. Use an explicit RESULT variable for direct recursion
(12.5.2.1)

Re: Am I just up too late?

<e456309d-5b27-430b-88d9-2628add18605n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a0c:f3c9:0:b0:4bb:cf03:d5b0 with SMTP id f9-20020a0cf3c9000000b004bbcf03d5b0mr55313196qvm.36.1668077730994;
Thu, 10 Nov 2022 02:55:30 -0800 (PST)
X-Received: by 2002:ac8:154:0:b0:3a5:1b00:edac with SMTP id
f20-20020ac80154000000b003a51b00edacmr48938411qtg.627.1668077730855; Thu, 10
Nov 2022 02:55:30 -0800 (PST)
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, 10 Nov 2022 02:55:30 -0800 (PST)
In-Reply-To: <tkiiid$hf4h$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:a148:4353:5cb9:106b;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:a148:4353:5cb9:106b
References: <tkiiid$hf4h$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e456309d-5b27-430b-88d9-2628add18605n@googlegroups.com>
Subject: Re: Am I just up too late?
From: gah4@u.washington.edu (gah4)
Injection-Date: Thu, 10 Nov 2022 10:55:30 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1980
 by: gah4 - Thu, 10 Nov 2022 10:55 UTC

On Thursday, November 10, 2022 at 2:08:17 AM UTC-8, James Van Buskirk wrote:
> This seemed kind of weird to me. Am I just up too late?
>
> D:\gfortran\james>type bug5.f90
> recursive function bug5(x)
> implicit none
> character(*), intent(in) :: x
> character(:), allocatable :: bug5
> bug5 = x
> if(bug5(1:1) == 'Z') bug5 = '_'//bug5
> end function bug5

(snip)

> 6 | if(bug5(1:1) == 'Z') bug5 = '_'//bug5
> | 1
> Error: 'bug5' at (1) is the name of a recursive function and so refers to
> the re
> sult variable. Use an explicit RESULT variable for direct recursion
> (12.5.2.1)

Funniest bug message I can remember.

The whole idea of a result variable is that you can use it as a variable.

It looks like someone tried to catch the accidental use of recursion,
but got it wrong.

Does it work with a RESULT declaration?

Re: Am I just up too late?

<3a4f4834-9409-491f-b704-17308c73cba1n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ac8:5691:0:b0:398:27cc:8c31 with SMTP id h17-20020ac85691000000b0039827cc8c31mr1225287qta.416.1668084706091;
Thu, 10 Nov 2022 04:51:46 -0800 (PST)
X-Received: by 2002:a37:9883:0:b0:6fa:9fa4:f042 with SMTP id
a125-20020a379883000000b006fa9fa4f042mr21553090qke.162.1668084705915; Thu, 10
Nov 2022 04:51:45 -0800 (PST)
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, 10 Nov 2022 04:51:45 -0800 (PST)
In-Reply-To: <tkiiid$hf4h$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=136.226.51.0; posting-account=ZZXq9AoAAAAQEcA7zKAGm0UFQh4gMBv7
NNTP-Posting-Host: 136.226.51.0
References: <tkiiid$hf4h$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3a4f4834-9409-491f-b704-17308c73cba1n@googlegroups.com>
Subject: Re: Am I just up too late?
From: parekhvs@gmail.com (FortranFan)
Injection-Date: Thu, 10 Nov 2022 12:51:46 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1733
 by: FortranFan - Thu, 10 Nov 2022 12:51 UTC

On Thursday, November 10, 2022 at 5:08:17 AM UTC-5, James Van Buskirk wrote:
> This seemed kind of weird to me. Am I just up too late?
> ..
> D:\gfortran\james>gfortran -c bug5.f90
> bug5.f90:6:11:
>
> 6 | if(bug5(1:1) == 'Z') bug5 = '_'//bug5
> | 1
> Error: 'bug5' at (1) is the name of a recursive function and so refers to
> the re
> sult variable. Use an explicit RESULT variable for direct recursion
> (12.5.2.1)

Perhaps the feedback from Fortran standard Editor and the discussion in this thread might help clarify whether the compiler might be wrong or right here:
https://groups.google.com/g/comp.lang.fortran/c/R7ztyouBwFw/m/FgJGEo-GDQAJ

Re: Am I just up too late?

<jt4l26F57fbU1@mid.individual.net>

  copy mid

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

  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: Am I just up too late?
Date: Thu, 10 Nov 2022 10:52:38 -0500
Lines: 29
Message-ID: <jt4l26F57fbU1@mid.individual.net>
References: <tkiiid$hf4h$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net nndlaeKyGOd+m4tpN/otuQl+joUmq+JhKBGxOVbzRCubcsMJOr
Cancel-Lock: sha1:EotzNt6YuHXOzBj05vBt2PfT4vk=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:107.0) Gecko/20100101
Thunderbird/107.0
Content-Language: en-US
In-Reply-To: <tkiiid$hf4h$1@dont-email.me>
 by: Steve Lionel - Thu, 10 Nov 2022 15:52 UTC

On 11/10/2022 5:07 AM, James Van Buskirk wrote:
> This seemed kind of weird to me. Am I just up too late?

You've stayed up far too long without updating - the compiler you're
using is 7.5 years old. Intel Fortran is now free, so no excuse not to
update.

D:\Projects>type james.f90
recursive function bug5(x)
implicit none
character(*), intent(in) :: x
character(:), allocatable :: bug5
bug5 = x
if(bug5(1:1) == 'Z') bug5 = '_'//bug5
end function bug5
D:\Projects>ifort/c james.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running
on Intel(R) 64, Version 2021.7.0 Build 20220726_000000
Copyright (C) 1985-2022 Intel Corporation. All rights reserved.
--
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: Am I just up too late?

<jt4l5pF57fbU2@mid.individual.net>

  copy mid

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

  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: Am I just up too late?
Date: Thu, 10 Nov 2022 10:54:34 -0500
Lines: 18
Message-ID: <jt4l5pF57fbU2@mid.individual.net>
References: <tkiiid$hf4h$1@dont-email.me> <jt4l26F57fbU1@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net v0U1u3dChQOZ9RslFPfeQw7b+1iKgESRCAbs2xwNMU6rKaH2AR
Cancel-Lock: sha1:8+uYhyoEsaruo55BeObnxx3HbAo=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:107.0) Gecko/20100101
Thunderbird/107.0
Content-Language: en-US
In-Reply-To: <jt4l26F57fbU1@mid.individual.net>
 by: Steve Lionel - Thu, 10 Nov 2022 15:54 UTC

On 11/10/2022 10:52 AM, Steve Lionel wrote:
> You've stayed up far too long without updating - the compiler you're
> using is 7.5 years old. Intel Fortran is now free, so no excuse not to
> update.

Perhaps I woke up too soon - ifort still thinks the code is fine, it was
gfortran you were asking about. But my point about updating still holds.

--
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: Am I just up too late?

<2faf5e9c-6692-48e7-85a6-a26af813132bn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:6214:d65:b0:4bc:8cd:6d6b with SMTP id 5-20020a0562140d6500b004bc08cd6d6bmr51188241qvs.19.1668097759207;
Thu, 10 Nov 2022 08:29:19 -0800 (PST)
X-Received: by 2002:a0c:f647:0:b0:4bb:701c:6171 with SMTP id
s7-20020a0cf647000000b004bb701c6171mr1430029qvm.100.1668097758983; Thu, 10
Nov 2022 08:29:18 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.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, 10 Nov 2022 08:29:18 -0800 (PST)
In-Reply-To: <jt4l5pF57fbU2@mid.individual.net>
Injection-Info: google-groups.googlegroups.com; posting-host=136.226.61.6; posting-account=ZZXq9AoAAAAQEcA7zKAGm0UFQh4gMBv7
NNTP-Posting-Host: 136.226.61.6
References: <tkiiid$hf4h$1@dont-email.me> <jt4l26F57fbU1@mid.individual.net> <jt4l5pF57fbU2@mid.individual.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2faf5e9c-6692-48e7-85a6-a26af813132bn@googlegroups.com>
Subject: Re: Am I just up too late?
From: parekhvs@gmail.com (FortranFan)
Injection-Date: Thu, 10 Nov 2022 16:29:19 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2172
 by: FortranFan - Thu, 10 Nov 2022 16:29 UTC

On Thursday, November 10, 2022 at 10:54:36 AM UTC-5, Steve Lionel wrote:

> On 11/10/2022 10:52 AM, Steve Lionel wrote:
> > You've stayed up far too long without updating - the compiler you're
> > using is 7.5 years old. Intel Fortran is now free, so no excuse not to
> > update.
> Perhaps I woke up too soon - ifort still thinks the code is fine, it was
> gfortran you were asking about. But my point about updating still holds.
> --

Steve,

Re: "Perhaps I woke up too soon - ifort still thinks the code is fine ..", by phrasing it this way, are you thinking the code is *not* fine? If so, what do you think is the case?

You may recall the previous discussion on a related topic at this forum a few months ago and the Malcolm Cohen feedback you fetched and posted - see the link upthread. Keeping that in mind, you think something is amiss with the code here? I fail to see that.

Perhaps you will also try out NAG compiler?

Thanks,

Re: Am I just up too late?

<3a3ddb90-8129-42f3-bef2-6853be861b0an@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ac8:5aca:0:b0:3a5:73a:1aa5 with SMTP id d10-20020ac85aca000000b003a5073a1aa5mr52508123qtd.579.1668103780509;
Thu, 10 Nov 2022 10:09:40 -0800 (PST)
X-Received: by 2002:a05:622a:2597:b0:3a5:acae:1645 with SMTP id
cj23-20020a05622a259700b003a5acae1645mr705850qtb.339.1668103780291; Thu, 10
Nov 2022 10:09:40 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.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, 10 Nov 2022 10:09:40 -0800 (PST)
In-Reply-To: <tkiiid$hf4h$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=12.154.207.45; posting-account=ZT-cAwoAAACx2tBPXm-WZoHIT8sjnGGy
NNTP-Posting-Host: 12.154.207.45
References: <tkiiid$hf4h$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3a3ddb90-8129-42f3-bef2-6853be861b0an@googlegroups.com>
Subject: Re: Am I just up too late?
From: pklausler@nvidia.com (Peter Klausler US)
Injection-Date: Thu, 10 Nov 2022 18:09:40 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1491
 by: Peter Klausler US - Thu, 10 Nov 2022 18:09 UTC

On Thursday, November 10, 2022 at 2:08:17 AM UTC-8, James Van Buskirk wrote:
> recursive function bug5(x)
> implicit none
> character(*), intent(in) :: x
> character(:), allocatable :: bug5
> bug5 = x
> if(bug5(1:1) == 'Z') bug5 = '_'//bug5
> end function bug5

This code is fine. If a compiler complains about it, please submit a bug report if the bug is in the most recent version of the compiler.

Re: Am I just up too late?

<tkjhfr$jqa8$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: not_valid@comcast.net (James Van Buskirk)
Newsgroups: comp.lang.fortran
Subject: Re: Am I just up too late?
Date: Thu, 10 Nov 2022 11:55:05 -0700
Organization: A noiseless patient Spider
Lines: 1
Message-ID: <tkjhfr$jqa8$1@dont-email.me>
References: <tkiiid$hf4h$1@dont-email.me> <jt4l26F57fbU1@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain;
format=flowed;
charset="UTF-8";
reply-type=response
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 10 Nov 2022 18:55:55 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="60b7d5a4000874c6684d8cc1f1c332a2";
logging-data="649544"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19jBrwNSyanoBuseEWpfZjYekGckwzPTrI="
Cancel-Lock: sha1:cSqpRPc4MjoDT3RBJDy+i2t2P1o=
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331
X-MSMail-Priority: Normal
In-Reply-To: <jt4l26F57fbU1@mid.individual.net>
X-Priority: 3
X-Newsreader: Microsoft Windows Live Mail 16.4.3528.331
 by: James Van Buskirk - Thu, 10 Nov 2022 18:55 UTC

"Steve Lionel" wrote in message news:jt4l26F57fbU1@mid.individual.net...

> You've stayed up far too long without updating - the compiler you're
> using is 7.5 years old. Intel Fortran is now free, so no excuse not to
> update.

I can always find excuses :) Intel Fortran and Atmel seem to like to
fight over Developer Studio, so every change can be problematic
and affect functionality that is only indirectly tied to it. But you have
to play with your Arduino, so what can you do?

Not to mention being sleep-deprived after my latest round of
working on my program, so I don't really have time and energy
to address any problems that may arise when updating, which
I assume would also involve updating Developer Studio.

But my old ifort does crash on my program whereas gfortran
doesn't if I work around its bugs like thinking it has two
different versions of C_PTR or not having a useful value of
the STATUS= argument to GET_COMMAND_ARGUMENT when
LEN(VALUE) == 0. When I get some spare time I intend to
upgrade ifort before investigating why the old version I have
crashes.

Re: Am I just up too late?

<tkjl20$k10b$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: nddtwentyone@gmail.com (Neil)
Newsgroups: comp.lang.fortran
Subject: Re: Am I just up too late?
Date: Thu, 10 Nov 2022 19:56:51 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 45
Message-ID: <tkjl20$k10b$1@dont-email.me>
References: <tkiiid$hf4h$1@dont-email.me> <3a3ddb90-8129-42f3-bef2-6853be861b0an@googlegroups.com>
Injection-Date: Thu, 10 Nov 2022 19:56:51 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="a9a42476815cb452d3f562cd4451c4be";
logging-data="656395"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19aOMhhHpXTqGaNxdi5EVCQ"
User-Agent: tin/2.6.2-20220130 ("Convalmore") (Linux/5.15.0-52-generic (x86_64))
Cancel-Lock: sha1:yJcPUN+T8gn4iF8VfcTehYJpU0I=
 by: Neil - Thu, 10 Nov 2022 19:56 UTC

Peter Klausler US <pklausler@nvidia.com> wrote:
> On Thursday, November 10, 2022 at 2:08:17 AM UTC-8, James Van Buskirk wrote:
>> recursive function bug5(x)
>> implicit none
>> character(*), intent(in) :: x
>> character(:), allocatable :: bug5
>> bug5 = x
>> if(bug5(1:1) == 'Z') bug5 = '_'//bug5
>> end function bug5
>
> This code is fine. If a compiler complains about it, please submit a bug report if the bug is in the most recent version of the compiler.

Here is the result obtained using the NAG compiler:

pyb075000011:~> cat bug5.f90
recursive function bug5(x)
implicit none
character(*), intent(in) :: x
character(:), allocatable :: bug5
bug5 = x
if(bug5(1:1) == 'Z') bug5 = '_'//bug5
end function bug5

program test
interface
recursive function bug5(x)
character(*), intent(in) :: x
character(:), allocatable :: bug5
end function bug5
end interface
write(*,*)bug5("Arthur")
write(*,*)bug5("Zaphod")
end program test

pyb075000011:~> nagfor -C=all -C=undefined -gline -info -nan -O0 -strict95 -u -v bug5.f90
NAG Fortran Compiler Release 7.1(Hanzomon) Build 7101
bug5.f90:
[NAG Fortran Compiler normal termination]
Loading...

pyb075000011:~> ./a.out
Arthur
_Zaphod

Re: Am I just up too late?

<7147e988-7246-4ec9-80db-cc9dee08fbe5n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:491:b0:6f9:de1b:8814 with SMTP id 17-20020a05620a049100b006f9de1b8814mr1792037qkr.18.1668112784479;
Thu, 10 Nov 2022 12:39:44 -0800 (PST)
X-Received: by 2002:a05:620a:1707:b0:6fa:349b:7ba9 with SMTP id
az7-20020a05620a170700b006fa349b7ba9mr1808374qkb.339.1668112784323; Thu, 10
Nov 2022 12:39:44 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.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, 10 Nov 2022 12:39:44 -0800 (PST)
In-Reply-To: <tkiiid$hf4h$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:e021:8644:700f:cf57;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:e021:8644:700f:cf57
References: <tkiiid$hf4h$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7147e988-7246-4ec9-80db-cc9dee08fbe5n@googlegroups.com>
Subject: Re: Am I just up too late?
From: gah4@u.washington.edu (gah4)
Injection-Date: Thu, 10 Nov 2022 20:39:44 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2228
 by: gah4 - Thu, 10 Nov 2022 20:39 UTC

On Thursday, November 10, 2022 at 2:08:17 AM UTC-8, James Van Buskirk wrote:

(snip)

> recursive function bug5(x)
> implicit none
> character(*), intent(in) :: x
> character(:), allocatable :: bug5
> bug5 = x
> if(bug5(1:1) == 'Z') bug5 = '_'//bug5
> end function bug5

There is no function call form where arguments have a : in them.

This does remind me, which version of the standard added allocate
on assignment for the length of CHARACTER variables?

I thought that was later than for arrays, but might have forgotten.

This test on Z reminds me that not so long ago, I was working with
IBM's ECAP, from the late Fortran II and early Fortran IV days.

It seems that the version I have is for a compiler that only allows
for 5 character variable names. (Part of the BASIC Fortran standard.)

There are WRITE statements that print out values, including the
original name, though.

In any case, they took all the six letter names, removed the center two
characters and replaced them with a Z. It seems that resulted in
unique enough names, but they are funny to read.

Re: Am I just up too late?

<c0721675-f40e-48ce-bdfd-84149438bb33n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ad4:4f31:0:b0:4bc:176f:a4fc with SMTP id fc17-20020ad44f31000000b004bc176fa4fcmr2277639qvb.112.1668124046907;
Thu, 10 Nov 2022 15:47:26 -0800 (PST)
X-Received: by 2002:a05:620a:22f8:b0:6fb:9b2:b946 with SMTP id
p24-20020a05620a22f800b006fb09b2b946mr1535808qki.487.1668124046779; Thu, 10
Nov 2022 15:47:26 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.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, 10 Nov 2022 15:47:26 -0800 (PST)
In-Reply-To: <7147e988-7246-4ec9-80db-cc9dee08fbe5n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:546:300:4c20:513f:babe:2f52:dc5;
posting-account=7tVJUQoAAACymEG6aShD5R0lhHCm_A0r
NNTP-Posting-Host: 2601:546:300:4c20:513f:babe:2f52:dc5
References: <tkiiid$hf4h$1@dont-email.me> <7147e988-7246-4ec9-80db-cc9dee08fbe5n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c0721675-f40e-48ce-bdfd-84149438bb33n@googlegroups.com>
Subject: Re: Am I just up too late?
From: urbanjost@comcast.net (John)
Injection-Date: Thu, 10 Nov 2022 23:47:26 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2595
 by: John - Thu, 10 Nov 2022 23:47 UTC

Perhaps I have been up too long myself. I thought the RESULT() syntax was
added specifically to allow unambigious recursion and would be the answer
as if bug5() took no parameters what would "//bug5" mean, as () is often optional,
or it it took an integer argument but returned an integer array is bug5(3) a reference
to an element or a recursive call to the procedure, and so on. I would have used RESULT(ANSWER)
on any recursive procedure ( I actually see no recursion here, by the way (?) ; but perhaps that is
just an old habit because of bugs I hit in the past as I was surprised it was required. Although I was
really surprised that recursive was becoming the default and wondered why that did not break a lot
things. Anyway, interesting. Some old assumptions I had are apparently wrong; bug using RESULT(ANSWER)
gfortran quit complaining. Gives me a few things to look back up and reread.

recursive function bug5(x) result(answer)
implicit none
character(*), intent(in) :: x
character(:), allocatable :: answer
answer = x
if(answer(1:1) == 'Z') answer = '_'//answer
end function bug5

recursive program test
interface
function bug5(x)
character(*), intent(in) :: x
character(:), allocatable :: bug5
end function bug5
end interface
write(*,*)bug5("Arthur")
write(*,*)bug5("Zaphod")
end program test

Maybe a gfortran bug is what made me form that habit.

Re: Am I just up too late?

<f0727025-9352-4084-85ef-2eb67f68df29n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a0c:ca0a:0:b0:4b9:ef84:afc3 with SMTP id c10-20020a0cca0a000000b004b9ef84afc3mr210989qvk.57.1668127380865;
Thu, 10 Nov 2022 16:43:00 -0800 (PST)
X-Received: by 2002:ad4:5228:0:b0:4bb:8b93:7302 with SMTP id
r8-20020ad45228000000b004bb8b937302mr199333qvq.63.1668127380718; Thu, 10 Nov
2022 16:43:00 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.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, 10 Nov 2022 16:43:00 -0800 (PST)
In-Reply-To: <c0721675-f40e-48ce-bdfd-84149438bb33n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:e021:8644:700f:cf57;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:e021:8644:700f:cf57
References: <tkiiid$hf4h$1@dont-email.me> <7147e988-7246-4ec9-80db-cc9dee08fbe5n@googlegroups.com>
<c0721675-f40e-48ce-bdfd-84149438bb33n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f0727025-9352-4084-85ef-2eb67f68df29n@googlegroups.com>
Subject: Re: Am I just up too late?
From: gah4@u.washington.edu (gah4)
Injection-Date: Fri, 11 Nov 2022 00:43:00 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1955
 by: gah4 - Fri, 11 Nov 2022 00:43 UTC

On Thursday, November 10, 2022 at 3:47:28 PM UTC-8, John wrote:
> Perhaps I have been up too long myself. I thought the RESULT() syntax was
> added specifically to allow unambigious recursion and would be the answer
> as if bug5() took no parameters what would "//bug5" mean, as () is often optional,
Yes it is supposed to be unambiguous. Without RESULT, the name is always
the result variable. That is why the message is so funny!

It assumes something that can't be true, and then gives an error.

Now, I could see a warning, but it has to assume the result variable
in any case.

It might be that so few use the RECURSIVE attribute, that it hasn't
been tested enough.

Re: Am I just up too late?

<jt5lggF57fbU3@mid.individual.net>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!aioe.org!news.mb-net.net!open-news-network.org!news.mind.de!bolzen.all.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: steve@seesignature.invalid (Steve Lionel)
Newsgroups: comp.lang.fortran
Subject: Re: Am I just up too late?
Date: Thu, 10 Nov 2022 20:06:25 -0500
Lines: 23
Message-ID: <jt5lggF57fbU3@mid.individual.net>
References: <tkiiid$hf4h$1@dont-email.me> <jt4l26F57fbU1@mid.individual.net>
<jt4l5pF57fbU2@mid.individual.net>
<2faf5e9c-6692-48e7-85a6-a26af813132bn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net aSl7LbfpCAViWC4JdN7JiQ9T+twslfIy1mF4eW4clauAe4CWzJ
Cancel-Lock: sha1:4/H3qcnEBj6Atl9UQFvq31OAc2Y=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:107.0) Gecko/20100101
Thunderbird/107.0
Content-Language: en-US
In-Reply-To: <2faf5e9c-6692-48e7-85a6-a26af813132bn@googlegroups.com>
 by: Steve Lionel - Fri, 11 Nov 2022 01:06 UTC

On 11/10/2022 11:29 AM, FortranFan wrote:
> Steve,
>
> Re: "Perhaps I woke up too soon - ifort still thinks the code is fine ..", by phrasing it this way, are you thinking the code is*not* fine? If so, what do you think is the case?
>
> You may recall the previous discussion on a related topic at this forum a few months ago and the Malcolm Cohen feedback you fetched and posted - see the link upthread. Keeping that in mind, you think something is amiss with the code here? I fail to see that.
>
> Perhaps you will also try out NAG compiler?

The code is fine - I did not intend to imply otherwise. NAG Fortran also
accepts it.

--
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: Am I just up too late?

<jt5macF57fbU4@mid.individual.net>

  copy mid

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

  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: Am I just up too late?
Date: Thu, 10 Nov 2022 20:20:12 -0500
Lines: 15
Message-ID: <jt5macF57fbU4@mid.individual.net>
References: <tkiiid$hf4h$1@dont-email.me>
<7147e988-7246-4ec9-80db-cc9dee08fbe5n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net t8gQd10Uw++W35HYctnOawQyaZTOfjlxOASsHyyStdPiWhADXo
Cancel-Lock: sha1:Zg+CRz0QlMSQAIXmkbCMY3sngLg=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:107.0) Gecko/20100101
Thunderbird/107.0
Content-Language: en-US
In-Reply-To: <7147e988-7246-4ec9-80db-cc9dee08fbe5n@googlegroups.com>
 by: Steve Lionel - Fri, 11 Nov 2022 01:20 UTC

On 11/10/2022 3:39 PM, gah4 wrote:
> This does remind me, which version of the standard added allocate
> on assignment for the length of CHARACTER variables?

Deferred-length character allocatables were added in F2003.
--
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: Am I just up too late?

<13f5a1eb-7580-45f4-9cd1-ee9274b42b02n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:620a:6c9:b0:6fa:9d10:1784 with SMTP id 9-20020a05620a06c900b006fa9d101784mr2386669qky.627.1668129924911;
Thu, 10 Nov 2022 17:25:24 -0800 (PST)
X-Received: by 2002:ac8:5219:0:b0:39d:3b6:3779 with SMTP id
r25-20020ac85219000000b0039d03b63779mr2614858qtn.196.1668129924783; Thu, 10
Nov 2022 17:25:24 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.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, 10 Nov 2022 17:25:24 -0800 (PST)
In-Reply-To: <tkiiid$hf4h$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:e021:8644:700f:cf57;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:e021:8644:700f:cf57
References: <tkiiid$hf4h$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <13f5a1eb-7580-45f4-9cd1-ee9274b42b02n@googlegroups.com>
Subject: Re: Am I just up too late?
From: gah4@u.washington.edu (gah4)
Injection-Date: Fri, 11 Nov 2022 01:25:24 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1894
 by: gah4 - Fri, 11 Nov 2022 01:25 UTC

On Thursday, November 10, 2022 at 2:08:17 AM UTC-8, James Van Buskirk wrote:

(snip)

> recursive function bug5(x)
> implicit none
> character(*), intent(in) :: x
> character(:), allocatable :: bug5
> bug5 = x
> if(bug5(1:1) == 'Z') bug5 = '_'//bug5
> end function bug5

Agreeing that this should be fine, I suspect I would have
used x(1:1) instead of bug5(1:1).

Three fewer characters to type.

Reminds me that, not too many years ago, in explaining
something to someone, I used "less than".
I was then corrected, and told it should be "fewer then"
for discrete values.

I quickly figure out that couldn't be right, as Fortran does
not have a .FT. operator. Less than has to also work for
integer values.

OK, three less characters to type.

Re: Am I just up too late?

<24483f0e-941e-4bef-a058-c79485d1dfe5n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ac8:6e89:0:b0:398:fec:d89 with SMTP id c9-20020ac86e89000000b003980fec0d89mr2649968qtv.351.1668130023542;
Thu, 10 Nov 2022 17:27:03 -0800 (PST)
X-Received: by 2002:ae9:e40f:0:b0:6ce:7d05:9f9e with SMTP id
q15-20020ae9e40f000000b006ce7d059f9emr2543143qkc.409.1668130023416; Thu, 10
Nov 2022 17:27:03 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.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, 10 Nov 2022 17:27:03 -0800 (PST)
In-Reply-To: <jt5macF57fbU4@mid.individual.net>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:e021:8644:700f:cf57;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:e021:8644:700f:cf57
References: <tkiiid$hf4h$1@dont-email.me> <7147e988-7246-4ec9-80db-cc9dee08fbe5n@googlegroups.com>
<jt5macF57fbU4@mid.individual.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <24483f0e-941e-4bef-a058-c79485d1dfe5n@googlegroups.com>
Subject: Re: Am I just up too late?
From: gah4@u.washington.edu (gah4)
Injection-Date: Fri, 11 Nov 2022 01:27:03 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1559
 by: gah4 - Fri, 11 Nov 2022 01:27 UTC

On Thursday, November 10, 2022 at 5:20:16 PM UTC-8, Steve Lionel wrote:

(I wrote)

> > This does remind me, which version of the standard added allocate
> > on assignment for the length of CHARACTER variables?

> Deferred-length character allocatables were added in F2003.

Just to be sure, also allocate on assignment at the same time?

Re: Am I just up too late?

<tkl2t7$qh3l$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: not_valid@comcast.net (James Van Buskirk)
Newsgroups: comp.lang.fortran
Subject: Re: Am I just up too late?
Date: Fri, 11 Nov 2022 01:58:29 -0700
Organization: A noiseless patient Spider
Lines: 2
Message-ID: <tkl2t7$qh3l$1@dont-email.me>
References: <tkiiid$hf4h$1@dont-email.me> <7147e988-7246-4ec9-80db-cc9dee08fbe5n@googlegroups.com> <c0721675-f40e-48ce-bdfd-84149438bb33n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain;
format=flowed;
charset="UTF-8";
reply-type=original
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 11 Nov 2022 08:59:19 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="307511bbedd46ea7f47a399887990b96";
logging-data="869493"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+2LKvCJB5PF0GXte3FvBLo+mmPM56ergQ="
Cancel-Lock: sha1:kTd62yu/KDmnypCyuO1JRecW3dM=
X-Newsreader: Microsoft Windows Live Mail 16.4.3528.331
X-Priority: 3
Importance: Normal
In-Reply-To: <c0721675-f40e-48ce-bdfd-84149438bb33n@googlegroups.com>
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331
 by: James Van Buskirk - Fri, 11 Nov 2022 08:58 UTC

"John" wrote in message
news:c0721675-f40e-48ce-bdfd-84149438bb33n@googlegroups.com...

> ( I actually see no recursion here, by the way (?)

The recursion happened because the function was called
in a multithreaded context. Before RECURSIVE was made
the default, local variables could be given the SAVE
attribute by the compiler if it wanted to, like in F77.
Declaring a procedure as RECURSIVE means that other
instances of the procedure in other threads would not
tromp on its unSAVEd local variables.

My workaround was, as you and others suggested,
to use a RESULT variable (but I called it 'bug5' :)

Re: Am I just up too late?

<084bb5e1-f7f5-47dc-9509-fdfdb89ef0bdn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:622a:1a88:b0:3a4:ef5c:c69d with SMTP id s8-20020a05622a1a8800b003a4ef5cc69dmr1471503qtc.194.1668177460746;
Fri, 11 Nov 2022 06:37:40 -0800 (PST)
X-Received: by 2002:ae9:f810:0:b0:6fa:f77:f8ea with SMTP id
x16-20020ae9f810000000b006fa0f77f8eamr1202920qkh.647.1668177460551; Fri, 11
Nov 2022 06:37:40 -0800 (PST)
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, 11 Nov 2022 06:37:40 -0800 (PST)
In-Reply-To: <tkiiid$hf4h$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=49.185.205.234; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le
NNTP-Posting-Host: 49.185.205.234
References: <tkiiid$hf4h$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <084bb5e1-f7f5-47dc-9509-fdfdb89ef0bdn@googlegroups.com>
Subject: Re: Am I just up too late?
From: robin.vowels@gmail.com (Robin Vowels)
Injection-Date: Fri, 11 Nov 2022 14:37:40 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2234
 by: Robin Vowels - Fri, 11 Nov 2022 14:37 UTC

On Thursday, November 10, 2022 at 9:08:17 PM UTC+11, James Van Buskirk wrote:
> This seemed kind of weird to me. Am I just up too late?
>
> D:\gfortran\james>type bug5.f90
> recursive function bug5(x)
> implicit none
> character(*), intent(in) :: x
> character(:), allocatable :: bug5
> bug5 = x
> if(bug5(1:1) == 'Z') bug5 = '_'//bug5
> end function bug5

You have written a recursive function, bug5.
Then in the IF statement, you ask for the value of BUG5. That's a recursive call.
Then in the true part of the statement, you again ask for the value of BUG5.
That requires another recursive call.

> D:\gfortran\james>ifort /c bug5.f90
> Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on
> Inte
> l(R) 64, Version 15.0.2.179 Build 20150121
> Copyright (C) 1985-2015 Intel Corporation. All rights reserved.
>
> D:\gfortran\james>gfortran -c bug5.f90
> bug5.f90:6:11:
>
> 6 | if(bug5(1:1) == 'Z') bug5 = '_'//bug5
> | 1
> Error: 'bug5' at (1) is the name of a recursive function and so refers to
> the result variable. Use an explicit RESULT variable for direct recursion
> (12.5.2.1)

Re: Am I just up too late?

<b3f1a258-d6ea-4593-a456-3161d08a4215n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:6214:a65:b0:4b1:7201:7673 with SMTP id ef5-20020a0562140a6500b004b172017673mr2115918qvb.62.1668177996622;
Fri, 11 Nov 2022 06:46:36 -0800 (PST)
X-Received: by 2002:a37:9343:0:b0:6ce:7d05:9f9e with SMTP id
v64-20020a379343000000b006ce7d059f9emr1257012qkd.409.1668177996445; Fri, 11
Nov 2022 06:46:36 -0800 (PST)
Path: i2pn2.org!i2pn.org!news.nntp4.net!pasdenom.info!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Fri, 11 Nov 2022 06:46:36 -0800 (PST)
In-Reply-To: <3a3ddb90-8129-42f3-bef2-6853be861b0an@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=49.185.205.234; posting-account=S_MdrwoAAAD7T2pxG2e393dk6y0tc0Le
NNTP-Posting-Host: 49.185.205.234
References: <tkiiid$hf4h$1@dont-email.me> <3a3ddb90-8129-42f3-bef2-6853be861b0an@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b3f1a258-d6ea-4593-a456-3161d08a4215n@googlegroups.com>
Subject: Re: Am I just up too late?
From: robin.vowels@gmail.com (Robin Vowels)
Injection-Date: Fri, 11 Nov 2022 14:46:36 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Robin Vowels - Fri, 11 Nov 2022 14:46 UTC

On Friday, November 11, 2022 at 5:09:42 AM UTC+11, Peter Klausler US wrote:
> On Thursday, November 10, 2022 at 2:08:17 AM UTC-8, James Van Buskirk wrote:
> > recursive function bug5(x)
> > implicit none
> > character(*), intent(in) :: x
> > character(:), allocatable :: bug5
> > bug5 = x
> > if(bug5(1:1) == 'Z') bug5 = '_'//bug5
> > end function bug5
> This code is fine. If a compiler complains about it, please submit a bug report if the bug is in the most recent version of the compiler.
..
If the word "recursive" had been omitted, it might have been fine;
the name BUG5 in the IF statement (in 2 places) would have been treated as
if it were an ordinary variable.
With the word "recursive" present, any occurrence of the word BUG5 in an expression
constitutes a recursive reference.

Re: Am I just up too late?

<tkm9hj$u5t0$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: not_valid@comcast.net (James Van Buskirk)
Newsgroups: comp.lang.fortran
Subject: Re: Am I just up too late?
Date: Fri, 11 Nov 2022 12:57:48 -0700
Organization: A noiseless patient Spider
Lines: 9
Message-ID: <tkm9hj$u5t0$1@dont-email.me>
References: <tkiiid$hf4h$1@dont-email.me> <3a3ddb90-8129-42f3-bef2-6853be861b0an@googlegroups.com> <b3f1a258-d6ea-4593-a456-3161d08a4215n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain;
format=flowed;
charset="UTF-8";
reply-type=original
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 11 Nov 2022 19:58:43 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="cac5374c67d29a16b7bef690c8ca0f4a";
logging-data="989088"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18MXOeRI8NCwFj8rXVhe/OiBgkr0SJiT8A="
Cancel-Lock: sha1:dtoeYV3MRCmO3eBRcB3Ym+L0OW0=
X-Newsreader: Microsoft Windows Live Mail 16.4.3528.331
X-Priority: 3
X-MSMail-Priority: Normal
In-Reply-To: <b3f1a258-d6ea-4593-a456-3161d08a4215n@googlegroups.com>
X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331
Importance: Normal
 by: James Van Buskirk - Fri, 11 Nov 2022 19:57 UTC

"Robin Vowels" wrote in message
news:b3f1a258-d6ea-4593-a456-3161d08a4215n@googlegroups.com...

> On Friday, November 11, 2022 at 5:09:42 AM UTC+11, Peter Klausler US
> wrote:
> > On Thursday, November 10, 2022 at 2:08:17 AM UTC-8, James Van Buskirk
> > wrote:
> > > recursive function bug5(x)
> > > implicit none
> > > character(*), intent(in) :: x
> > > character(:), allocatable :: bug5
> > > bug5 = x
> > > if(bug5(1:1) == 'Z') bug5 = '_'//bug5
> > > end function bug5
> > This code is fine. If a compiler complains about it, please submit a bug
> > report if the bug is in the most recent version of the compiler.

> If the word "recursive" had been omitted, it might have been fine;
> the name BUG5 in the IF statement (in 2 places) would have been treated as
> if it were an ordinary variable.
> With the word "recursive" present, any occurrence of the word BUG5 in an
> expression
> constitutes a recursive reference.

From N2137, section 15.6.2.2:

If RESULT appears, the name of the function result of the function
is result-name and all occurrences of the function name in
execution-part statements in its scope refer to the function itself.
If RESULT does not appear, the name of the function result is
function-name and all occurrences of the function name in
execution-part statements in its scope are references to the
function result.

Re: Am I just up too late?

<jta9lkFm6nU1@mid.individual.net>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: steve@seesignature.invalid (Steve Lionel)
Newsgroups: comp.lang.fortran
Subject: Re: Am I just up too late?
Date: Sat, 12 Nov 2022 14:15:01 -0500
Lines: 27
Message-ID: <jta9lkFm6nU1@mid.individual.net>
References: <tkiiid$hf4h$1@dont-email.me>
<7147e988-7246-4ec9-80db-cc9dee08fbe5n@googlegroups.com>
<jt5macF57fbU4@mid.individual.net>
<24483f0e-941e-4bef-a058-c79485d1dfe5n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net 4UEwKTOK7ixmWdIW9kMW6gsFDXjCUvUIAZDdGOOz0vqw/lmc5V
Cancel-Lock: sha1:RKchVIXkkX+w69mwXmnfa8uWWwY=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:107.0) Gecko/20100101
Thunderbird/107.0
Content-Language: en-US
In-Reply-To: <24483f0e-941e-4bef-a058-c79485d1dfe5n@googlegroups.com>
 by: Steve Lionel - Sat, 12 Nov 2022 19:15 UTC

On 11/10/2022 8:27 PM, gah4 wrote:
> On Thursday, November 10, 2022 at 5:20:16 PM UTC-8, Steve Lionel wrote:
>
> (I wrote)
>
>>> This does remind me, which version of the standard added allocate
>>> on assignment for the length of CHARACTER variables?
>
>> Deferred-length character allocatables were added in F2003.
>
> Just to be sure, also allocate on assignment at the same time?

Yes. When ifort first implemented deferred-length allocatables,
(re)allocation was not the default, as it was for arrays. I argued,
successfully before release, that this was a new feature and
compatibility with F90 was not required. Of course, now, ifort does the
allocate-on-assignment by default for arrays too.
--
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