This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, Fortran] pad char to int conversions with spaces instead of zeros (legacy)
On 12/12/2018 11:52, Jakub Jelinek wrote:
integer(kind=2) :: a
a = -1
print *, transfer (1_2, 1_8), transfer (a, 1_8)
I assume you meant transfer (-1_2, 1_8), the result from gfortran is
65535 for both transfers.
I'm about to build the compiler with
memset (buffer, 0x20, buffer_size);
memset (buffer, (flag_dec_pad_with_spaces ? 0x20 : 0x0), buffer_size);
and will check again, if necessary a padding variable can be used
instead initially set to zero and changed to 0x20 when it is known that
the source is character.