3 ms·
> allocatable characters being used for internal writes can you explain this ?
by imachine1980_ 3y ago
> allocatable characters being used for internal writes
can you explain this ?
- pklausler 3y agoIf you allocate a character object, then write to it with an internal write statement, F’23 now requires that the variable be reallocated to the actual length of the formatted record, instead of retaining its former length and being padded out with blanks (or truncated). The LLVM Fortran compiler (Flang) has warnings for various usages whose semantics would change if F'23 semantics were adopted by default, which I'm not sure I want to do.
- EE84M3i 3y agoI've never used fortran so I'm not sure what a character object or an internal write is, but in C would this be something like allocating a character array and sprintf-ing to it?
- pklausler 3y agoThat's a good analogy, with the change being that sprintf is now somehow required to reallocate your buffer on every call if the length ever changes.