[patch, libgfortran] FIX PR19543 formatted output for logical(8) variables
Jerry DeLisle
jvdelisle@verizon.net
Sat Feb 4 06:17:00 GMT 2006
Jerry DeLisle wrote:
> The attached patch is a possible fix for this PR. It is obvious and
> simple and is probably a work around for the underlying problem in PR
> 20066.
>
> I noticed that the values being passed to write_logical are correct so I
> suspected the problem was types.
Blah, never mind. I see it does not work in all cases.
I still think that the types matching should be done though.
I realize that Tobi is working on the other part of this, was just curious
looking at it. This case is weird. If I comment out the two test lines the
prints come out correctly. If I allow the test lines, the prints come out wrong.
Heisenberg Uncertainty Principle. :)
Jerry
program test
implicit none
logical(1), parameter :: t1 = .TRUE., f1 = .FALSE.
logical(2), parameter :: t2 = .TRUE., f2 = .FALSE.
logical(4), parameter :: t4 = .TRUE., f4 = .FALSE.
logical(8), parameter :: t8 = .TRUE., f8 = .FALSE.
character*2 :: t(4), f(4)
write(t(1),*) t1
write(f(1),*) f1
write(t(2),*) t2
write(f(2),*) f2
write(t(3),*) t4
write(f(3),*) f4
write(t(4),*) t8
write(f(4),*) f8
print *, t
print *, f
! if (any(t .ne. "T")) call abort
! if (any(f .ne. "F")) call abort
end
Heisenberg Uncertainty Principle. :)
Jerry
More information about the Fortran
mailing list