This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, Fortran] pad char to int conversions with spaces instead of zeros (legacy)


Before delving into the code to make changes to handle the case when passing a variable into transfer instead of a literal I revised the the test cases. The results indicate to me that this patch as originally intended is erroneous.

When a character literal is assigned to character variable e.g.

character(len=8) :: a
a = 'ab'

The value is padded with spaces.

So any variable passed into the transfer statement will already be padded with spaces. So the easiest solution is to pad with spaces when a character literal is passed in instead of zeros as is currently the case.

Mark


--
https://www.codethink.co.uk/privacy.html


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]