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: [PATCH,gfortran] Fix for PR 17941


On Sat, Jan 15, 2005 at 11:07:44AM +0000, Paul Brook wrote:
> On Friday 31 December 2004 05:57, Steve Kargl wrote:
> > The attached patch fixes PR 17941.  The attached program
> > is a test program suitable for inclusion in the gfortran
> > testsuite.
> >
> > Briefly, gfortran could not deal with spaces between an
> > uniary plus/minus sign in a complex constant.  That is,
> > "complex, parameter :: c = (-   1.0,   +  2)" would invoke
> > an error.
> 
> This is supposed to be an error. Your code is illegal in free-form source, and 
> already accepted in fixed-form.
> 

Lahey also claims it is valid code.

Compiling program unit gfcbug17 at line 1:
Encountered 0 errors, 0 warnings, 0 informations in file SOURCE.F90.
Compiling file SOURCE.F90.

Lahey/Fujitsu Fortran 95 Listing and Cross Reference

Source file       : SOURCE.F90

 Main program "gfcbug17"
  (line-no.)(nest)
          1        !
          2        ! Test program for PR 17941.
          3        !
          4        program gfcbug17
          5          complex, parameter :: c0 = (-0.5, -     0.5)
          6          complex, parameter :: c1 = (-     0.5, +     0.5)
          7          complex, parameter :: c2 = (-    0.5E2, +0.5)
          8          complex, parameter :: c3 = (-0.5, +     0.5E-2)
          9          if (abs(c0 - cmplx(-0.5,-0.5)) > 1.E-4) call abort
         10          if (abs(c1 - cmplx(-0.5,+0.5)) > 1.E-4) call abort
         11          if (abs(c2 - cmplx(-0.5E2,+0.5)) > 1.E-4) call abort
         12          if (abs(c3 - cmplx(-0.5,+0.5E-2)) > 1.E-4) call abort
         13        end program gfcbug17
         14        

 Procedure information
   Lines      : 14
   Statements : 10

 Scoping unit of program : gfcbug17
   Attribute and Cross reference of name
     abort
      |(Class and Type) : external subroutine name
      |(Attributes)     : 
      |(Declaration)    : 
      |(Definition)     : 
      |(Reference)      : 9  10  11  12
     abs
      |(Class and Type) : intrinsic function name, REAL(4)
      |(Attributes)     : PURE, ELEMENTAL
      |(Declaration)    : 
      |(Definition)     : 
      |(Reference)      : 9  10  11  12
     c0
      |(Class and Type) : named constant, COMPLEX(4)
      |(Attributes)     : 
      |(Declaration)    : 5
      |(Definition)     : 
      |(Reference)      : 9
     c1
      |(Class and Type) : named constant, COMPLEX(4)
      |(Attributes)     : 
      |(Declaration)    : 6
      |(Definition)     : 
      |(Reference)      : 10
     c2
      |(Class and Type) : named constant, COMPLEX(4)
      |(Attributes)     : 
      |(Declaration)    : 7
      |(Definition)     : 
      |(Reference)      : 11
     c3
      |(Class and Type) : named constant, COMPLEX(4)
      |(Attributes)     : 
      |(Declaration)    : 8
      |(Definition)     : 
      |(Reference)      : 12
     cmplx
      |(Class and Type) : intrinsic function name, COMPLEX(4)
      |(Attributes)     : PURE, ELEMENTAL
      |(Declaration)    : 
      |(Definition)     : 
      |(Reference)      : 9  10  11  12
     gfcbug17
      |(Class and Type) : program name
      |(Attributes)     : 
      |(Declaration)    : 4
      |(Definition)     : 
      |(Reference)      : 13

 Total information
   Procedures       : 1
   Total lines      : 14
   Total statements : 10


-- 
Steve


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