Closed sskutnik closed 1 year ago
It's the caller's responsibility to pass in a trimmed string with my_function(trim(x))
if that's needed, since it's acceptable to have and pass strings with trailing whitespace and some applications may need/wish to do that. The missing decoration is a bug that I will fix!
When converting a C interface like the following:
this generates the following FORTRAN function:
The following FORTRAN helper function is likewise generatedL
We are noticing two problems in particular with this on some platforms.
len_trim(finp)+1
rather thanlen(finp)
to trim any trailing whitespaceintent(INOUT)
~intent(IN)
for some (stricter) compiler settings to avoid being implicitly assumed asintent(INOUT)
Specifically, if the function is called using a string constant, we observe the following error:
i.e., appending an explicit intent attribute fixes this issue for Intel Fortran.