This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: LOGICAL intrinsic seems to be broken


Hi Steve,

I don’t think the problem is specific to LOGICAL. AFAIU it is related to

     write(*,*) logical(.true., j(i)), logical_kinds(i)

where gfortran does not consider j(i) as a constant. This why I used the convoluted construct

  integer, parameter :: j(size(real_kinds)+4)=[REAL_KINDS, [4, 4, 4, 4]]
...
    if (i == 1) then
      write(astring, '(ru,g0)') 1.0/real(10.0, kind=j(1))
    else if (i == 2) then
      write(astring, '(ru,g0)') 1.0/real(10.0, kind=j(2))
    else if (i == 3) then
      write(astring, '(ru,g0)') 1.0/real(10.0, kind=j(3))
    else if (i == 4) then
      write(astring, '(ru,g0)') 1.0/real(10.0, kind=j(4))
    end if

in gfortran.dg/fmt_g0_7.f08.

I did not dig the standard to understand if gfortran is too restrictive in the interpretation of j(i).

Cheers,

Dominique


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