flang-compiler / f18

F18 is a front-end for Fortran intended to replace the existing front-end in the Flang compiler
230 stars 48 forks source link

Make hidden character length argument of type size_t #1082

Closed jabl closed 4 years ago

jabl commented 4 years ago

By looking at https://github.com/flang-compiler/f18/blob/master/documentation/Calls.md I couldn't figure out how f18 passes the hidden character length argument which is needed to handle CHARACTER(LEN=*) dummy arguments. So maybe my worry is unnecessary.

I would recommend f18 to pass the hidden character length argument as a C size_t type (or in Fortran lingo, INTEGER(kind=C_SIZE_T) ). This enables very long character variables, including allocatable characters (extremely unlikely, but still), and is what Ifort and GFortran are doing.

klausler commented 4 years ago

Yes, of course. The elem_len field of the descriptor is size_t, and so will the hidden length arguments be for procedures not requiring interfaces.