[J3] Is this legal in F202X? Rank agnosticism and scalars

Vipul Parekh parekhvs at gmail.com
Tue Jan 24 00:05:50 UTC 2023


On Mon, Jan 23, 2023 at 2:09 PM Clune, Thomas L. (GSFC-6101) via J3 <
j3 at mailman.j3-fortran.org> wrote:

> ..  Is the PRINT statement above legal?  ..
>

Hi Tom,

Does the code you show reduce to the following?
     integer :: a(0)
   integer :: idx(0)
   a = 42
   idx = 1
   print *, a( idx ), "; expected is ?"
end

or
     integer :: a(0)
   integer :: idx(0)
   a = 42
   idx = 1
   print *, a( @idx ), "; expected is ?"
end

Do you think constraint C825 toward the array option to specify multiple
subscripts starting Fortran 2023 covers both the cases above?

To me, it is unclear what the standard states with the first case above.
It appears the first case is nonconforming but there is no numbered
constraint for it specifically to detect and report that.

Thanks,
Vipul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20230123/3d84a0be/attachment.htm>


More information about the J3 mailing list