Closed
Description
Generating the to_string function for logical arguments
The code for stdlib_ascii contains the following code:
#:for kind in INT_KINDS
!> Represent an logical of kind ${kind}$ as character sequence
pure function to_string_logical_${kind}$(val) result(string)
integer, parameter :: ik = ${kind}$
logical(ik), intent(in) :: val
character(len=1) :: string
string = merge("T", "F", val)
end function to_string_logical_${kind}$
#:endfor
Clearly instead of INT_KINDS a macro LOG_KINDS should be used.
However, the file common.fypp which defines these macros lacks a list for logical kinds.
Expected behaviour
The file stdlib_ascii should have:
#:for kind in LOG_KINDS
!> Represent an logical of kind ${kind}$ as character sequence
pure function to_string_logical_${kind}$(val) result(string)
And the file common.fypp should have:
#! Logical kinds to be considered during templating - fill in the correct names
#:set LOG_KINDS = [...]
#! Logical types to be considered during templating
#:set LOG_TYPES = ["logical({})".format(k) for k in LOG_KINDS]
Technical Details
The adjustments to the code should be obvious
Compiler version
Independent of the compiler
Platform and Architecture
All platforms - it concerns the source code