Yuao Ma wrote:
On 8/6/2025 10:57 PM, Yuao Ma wrote:
On 8/6/2025 4:32 PM, Tobias Burnus wrote:
Hi Yuao,

thanks for your patch. I have two nits:

* There is no diagnostic for -std=f2018 (or lower);
   can you add the 'gfc_notify_std (GFC_STD_F2023' ?

Done. Testcase added.

Given the "Fortran 2023:" prefix, I wonder whether the wording shouldn't be tweaked:

+  call c_f_pointer(x, ptr_2d, shape=myshape_2d, lower=mylower_2d) ! { dg-error "Fortran 2023: Unexpected LOWER argument at" }


It reads a bit as if with Fortran 2023, it is unexpected - but it is unexpected only with older versions.

I wonder whether it is clearer using: "Error: Fortran 2023: LOWER argument at"

What do you think?

* * *

* I have a minor documentation nit; current wording is
   at https://gcc.gnu.org/onlinedocs/gfortran/C_005fF_005fPOINTER.html
   Namely, ...

Yuao Ma wrote:

--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -3368,10 +3368,10 @@ Fortran 2003 and later
  @table @asis
  @item @emph{Synopsis}:
-@code{CALL C_F_POINTER(CPTR, FPTR[, SHAPE])}
+@code{CALL C_F_POINTER(CPTR, FPTR[, SHAPE, LOWER])}
  @item @emph{Description}:
-@code{C_F_POINTER(CPTR, FPTR[, SHAPE])} assigns the target of the C pointer +@code{C_F_POINTER(CPTR, FPTR[, SHAPE, LOWER])} assigns the target of the C pointer   @var{CPTR} to the Fortran pointer @var{FPTR} and specifies its shape.

I think some wording like the following is missing:

"For an array @var{FPTR}, the lower bounds are specified by @var{LOWER} if present and otherwise equal to 1."


Done.

Actually, I wonder whether this wording is better placed at the end of "Description:" instead of under "Arguments:" for 'LOWER'

See https://gcc.gnu.org/onlinedocs/gfortran/C_005fF_005fPOINTER.html for how it currently looks.

Do you concur?

* * *

Otherwise LGTM.

Tobias

PS: FYI – contrib/download_prerequisites now downloads MPFR 4.2.2, i.e. it will have the 'pi' support.

PPS: I am aware of other emails, esp. related to libquadmath, which someone (me?) should be take care of …

And:

PS: Eventually, we should update https://gcc.gnu.org/gcc-16/ changes.html for the accumulated Fortran changes … [That's the https://gcc.gnu.org/ about.html#git ]

Yes, we could summarize the work done for Fortran 2023, similar to how the Flang documentation(https://flang.llvm.org/docs/ FortranStandardsSupport.html#fortran-2023) does.

I think that's two separate documents:

One is about the news (release news, changes),
i.e. gcc.gnu.org/gcc-16/changes.html for the current pending changes,
https://gcc.gnu.org/gcc-15/changes.html#fortran is what we had last year.

That's somewhat easy as we only need to add the new stuff and it is just
unfortunate but not wrong to miss some features.

This is useful & has a low effort.

The other is to have a supported-feature list. That's quite nice,
but requires more maintenance work.

We have this kind of lists already in GCC:

For C:https://gcc.gnu.org/projects/c-status.html
For C++:https://gcc.gnu.org/projects/cxx-status.html
For the C++ standard 
library:https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html

For OpenMP - by version:https://gcc.gnu.org/projects/gomp/#implementation-status
and for a specific version (here mainline)
https://gcc.gnu.org/onlinedocs/libgomp/OpenMP-Implementation-Status.html
(in the .texi file, i.e. it also ships with GCC).

For gfortran, we have in the wiki →https://gcc.gnu.org/wiki/GFortran namely:
https://gcc.gnu.org/wiki/Fortran2003Status
https://gcc.gnu.org/wiki/Fortran2008Status
https://gcc.gnu.org/wiki/Fortran2018Status
https://gcc.gnu.org/wiki/TS29113Status

I think this has bitrotted a bit and a Fortran2023 version is missing.

Reply via email to