Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

VMS is like a nightmare about RXS-11M.


devel / comp.lang.fortran / Re: Conformant program or not?

SubjectAuthor
* Conformant program or not?Steve Lionel
`- Conformant program or not?John

1
Re: Conformant program or not?

<k7hrfiFdptdU1@mid.individual.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=3608&group=comp.lang.fortran#3608

  copy link   Newsgroups: comp.lang.fortran
Path: rocksolid2!i2pn.org!weretis.net!feeder8.news.weretis.net!lilly.ping.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: steve@seesignature.invalid (Steve Lionel)
Newsgroups: comp.lang.fortran
Subject: Re: Conformant program or not?
Date: Thu, 16 Mar 2023 20:44:33 -0400
Lines: 26
Message-ID: <k7hrfiFdptdU1@mid.individual.net>
References: <963ba9b6-9722-43b9-b8b2-062c6ce8cf60n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net xRFcDFaY78w3pT4/meW05wtYgX/Wh9e9keAMCSnq+s03iO/9Gh
Cancel-Lock: sha1:Wmne/DWkMI9MkFXSyRo1X7yiQaI=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:110.0) Gecko/20100101
Thunderbird/110.0
Content-Language: en-US
In-Reply-To: <963ba9b6-9722-43b9-b8b2-062c6ce8cf60n@googlegroups.com>
 by: Steve Lionel - Fri, 17 Mar 2023 00:44 UTC

On 3/16/2023 12:41 PM, Peter Klausler US wrote:
> complex, save, target :: a(10) = [(j,j=1,10)]
> real, pointer :: p(:) => a(1:9:2)%re
> print *, p
> end
>
>
> No released Fortran compiler to which I have access can compile and run this short program, but they each have a distinct error message or runtime crash. I think that it's conformant with Fortran 2018. Am I missing anything?

I discussed this with Malcolm (nagfor gets an internal error for it). We
both agree that this is awful, but valid F2018 code. It's an unfortunate
side effect of expanding the cases of pointer assignment - no good deed
goes unpunished.

Malcolm has entered a bug report against nagfor, and I will do one for
ifort/ifx (which gives a nonsense message, as you say.)
--
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: Conformant program or not?

<ec38945a-e01f-4eb7-9d65-617ca64dded0n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=3609&group=comp.lang.fortran#3609

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ae9:e211:0:b0:742:9e15:3e0 with SMTP id c17-20020ae9e211000000b007429e1503e0mr7085802qkc.5.1679045152951;
Fri, 17 Mar 2023 02:25:52 -0700 (PDT)
X-Received: by 2002:a05:6902:10e:b0:98e:6280:74ca with SMTP id
o14-20020a056902010e00b0098e628074camr27867025ybh.1.1679045152807; Fri, 17
Mar 2023 02:25:52 -0700 (PDT)
Path: rocksolid2!news.neodome.net!weretis.net!feeder8.news.weretis.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, 17 Mar 2023 02:25:52 -0700 (PDT)
In-Reply-To: <k7hrfiFdptdU1@mid.individual.net>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:546:300:4c20:3203:c8ff:fe14:5ceb;
posting-account=7tVJUQoAAACymEG6aShD5R0lhHCm_A0r
NNTP-Posting-Host: 2601:546:300:4c20:3203:c8ff:fe14:5ceb
References: <963ba9b6-9722-43b9-b8b2-062c6ce8cf60n@googlegroups.com> <k7hrfiFdptdU1@mid.individual.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ec38945a-e01f-4eb7-9d65-617ca64dded0n@googlegroups.com>
Subject: Re: Conformant program or not?
From: urbanjost@comcast.net (John)
Injection-Date: Fri, 17 Mar 2023 09:25:52 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: John - Fri, 17 Mar 2023 09:25 UTC

The ifort/ifx message would make sense if instead of a(1:3:2)%re it was real(a(1:3:2)) as that would be an expression; so I might have reported the bug in another form where if a%re was passed to a procedure that changed the value as a real argument. the value was not changed on return. Of course that would also be assigning a non-constant expression on initialization as well, but that is what you should
get (perhaps less cryptically) if you did not initialize it but used an assignment like "p=real(a(1:3:2))". If no one reported the segfault, which I
assume was gfortran I was going to report it as I do not see it in the bugzilla reports, with

program boom
implicit none
complex, save, target :: a(4)
#ifdef INITIALIZE
real, pointer :: p(:) => a(1:3:2)%re
#else
real, pointer :: p(:)
p => a(1:3:2)%re
#endif
a = [(1., 0.), (2., 0.), (3., 0.), (4., 0)]
print *, p
end program boom
t as it works with the assignment but not the initialization with the 12.2 version.

The ifort message would make sense if the error were

complex, save, target :: a(4)
real, pointer :: p(:)
a = [(1., 0.), (2., 0.), (3., 0.), (4., 0)]
p => real(a(1:3:2)) <== SHOULD get an error
!p => a(1:3:2)%re <== should work but does not
print *, p
end
xx.f90(4): error #6678: When the target is an expression it must deliver a pointer result.
p => real(a(1:3:2))

the message makes more sense seen in this context.

ifx appears to be treating a(1:3:2)%re as equivalent to real(a(1:3:2)), similar to the error I reported, although not totally sure fixing the previous report would fix this as well.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor