https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89266

--- Comment #4 from Harald Anlauf <anlauf at gmx dot de> ---
(In reply to Thomas Koenig from comment #1)
> Goes back a long time, at least to gcc 6.
> 
> I also think that this is valid code, but if somebody can find
> language in the standard that says otherwise, please correct.

The second test case is valid, but processor dependent according
to e.g. Fortran 2003:

13.7.121 TRANSFER (SOURCE, MOLD [, SIZE])

Result Value. [...]
If the physical representation of the result is longer than that of SOURCE,
the physical representation of the leading part is that of SOURCE and the
remainder is processor dependent.

Examples:

PGI, flang 1.5 give:
% ./a.out | cat -ve
 '^@     '            6$

sunf95, g95:
 '^@^@^@^@^@^@' 6$

Reply via email to