http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56149
Bug #: 56149
Summary: 64 bit gFortran-C interop hidden character argument
length passed as 32 bit value
Classification: Unclassified
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: fortran
AssignedTo: [email protected]
ReportedBy: [email protected]
This is not so much a bug but a significant gFortran limitation in my project
to port ClearWin+ to gFortran. Users will not want to edit all their "printf"
calls so that format strings become null terminated. This could be avoided if
the format string length where passed as a 64 bit integer. At the moment
gFortran passes a 32 bit value and allows garbage to remain in the HIDWORD so
the argument cannot safely be distinguished from a 64 bit address.
It would appear that there is no advantage in passing a 32 bit value in this
context.
As an aside, I would also suggest that interop programming would be much
simpler if literal character strings were stored in memory as null-terminated
strings.