[PATCH, Fortran] pad char to int conversions with spaces instead of zeros (legacy)
Mark Eggleston
mark.eggleston@codethink.co.uk
Wed Dec 12 22:52:00 GMT 2018
On 12/12/2018 12:06, Mark Eggleston wrote:
> I'm about to build the compiler with
>
> Â memset (buffer, 0x20, buffer_size);
>
> instead of
>
> Â 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.
It was indeed necessary to only use 0x20 for padding when the source is
known to be character. One more check was to transfer a character(4)
variable to an integer(8) variable, there is no space padding. I don't
yet know whether this matches the behaviour of other compilers.
I don't currently have access to other compilers. I can have some test
cases performed on xlf and SunStudio but won't get any answers until
after Christmas. The answer will determine whether I have any more work
to do.
Mark
--
https://www.codethink.co.uk/privacy.html
More information about the Fortran
mailing list