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

Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|DUPLICATE                   |---
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-04-14

--- Comment #4 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
Reopening this. I started working on the 'duplicate' portion of this which is
the 1X vs ' ' portion of it.  Then I realized the first sets of output have a
bunch of garbage in the output. My first thought was the allocatable strings
aspect of this.

I reduced this by removing those aspects of the original post to get the
following.

program tryit
   implicit none
   integer, parameter :: wp = kind(0d0)
   real(kind=wp) :: pi  =
3.14159265358979323846264338327950288419716939937510582097494459230_wp
   character(40) gen1
   character(40) gen2


   gen1 = '(19("."),t1,g0,1x,t21,g0)'
   gen2 = '(19("."),t1,g0," ",t21,g0)'

   write (*, gen1) 'PI', pi
   write (*, gen1) 'REAL(PI)', real(pi)
   write (*, gen1) 'DBLE(PI)', dble(pi)
   write (*, gen1) 'RADIX', radix(pi)
   write (*, gen1) 'RANGE', range(pi)
   write (*, gen1) 'PRECISION', precision(pi)
   write (*,'(80("-"))')
   write (*, gen2) 'PI', pi
   write (*, gen2) 'REAL(PI)', real(pi)
   write (*, gen2) 'DBLE(PI)', dble(pi)
   write (*, gen2) 'RADIX', radix(pi)
   write (*, gen2) 'RANGE', range(pi)
   write (*, gen2) 'PRECISION', precision(pi)
   write (*,'(80("-"))')
end program tryit

Which gives:

$ ./a.out 
PI................. 3.1415926535897931
REAL(PI)........... 3.14159274
DBLE(PI)........... 3.1415926535897931
RADIX.............. 3. 2
RANGE.............. 3. 307
PRECISION.......... 15
--------------------------------------------------------------------------------
PI ................ 3.1415926535897931
REAL(PI) .......... 3.14159274
DBLE(PI) .......... 3.1415926535897931
RADIX ............. 2
RANGE ............. 307
PRECISION ......... 15
--------------------------------------------------------------------------------

I will focus on the 1X vs ' ' aspect of this as it fits into the 113897 that I
am currently working.

Reply via email to