gfortran bug or not?



I use the following well-known trick for my numeric kinds:

integer, parameter, public :: sp = kind(1.0)
integer, parameter, public :: dp = selected_real_kind(2*precision(1.0_sp))
integer, parameter, public :: qp_preferred = &
selected_real_kind(2*precision(1.0_dp))
integer, parameter, public :: qp = (1+sign(1,qp_preferred))/2*qp_preferred+ &
(1-sign(1,qp_preferred))/2*dp

When i compile using the latest gfortran on Linux (4.3.0 20070824) i get:

gfortran -c -g -pedantic -Wall -Wimplicit-interface -Wunderflow -fbounds-check -fimplicit-none -std=f95 numeric_kinds.f95
numeric_kinds.f95:31.44:

(1-sign(1,qp_preferred))/2*dp
1
Error: Extension: Evaluation of nonstandard initialization expression at (1)
numeric_kinds.f95:37.45:

(1-sign(1,qp_preferred))/2*dp
1
Error: Extension: Evaluation of nonstandard initialization expression at (1)


Is this indeed an error or is gfortran wrong here? I've been using this
trick for a long time and it is the first time that a compiler complains
about it...

Thanks,
Bart

--
"Share what you know. Learn what you don't."
.



Relevant Pages

  • Re: Using user defined type in Fortan 77 subroutines
    ... 60 DDOT = DTEMP ... gfortran -c DNAD.f90 ... when I compile blas.for using ... regardless of whether the standard allows the ...
    (comp.lang.fortran)
  • Re: VS 2003 compiling error
    ... > way to compile the solution even after I close and re-open the solution. ... This trick is very cumbersome and I loose all my settings ... > like open files, break points and all other IDE settings. ...
    (microsoft.public.vsnet.general)
  • Re: Difficult example?
    ... > has a bug with its LOGICALtype and kind. ... if there were a gfortran compiler I could download I ... compile and run it, then compile and run the resulting ... You could wipe out all the subroutines except for ...
    (comp.lang.fortran)
  • Re: Can somebody Help me??
    ... compile the code with Portland Group f90 or hpf compiler. ... ifexit ... And, if, as you indicate it's taken by the other compilers it seems there's something wrong w/ the version of gfortran you're using on a very superficial reading. ... but OP does not mind for he uses Portland Group compiler in general and just checks compatiblity with gfortran when needed. ...
    (comp.lang.fortran)
  • Re: gfortran: bug or non-standard syntax?
    ... are changed are almost always the result of accessing an array (writing ... as any software gfortran is neither bugfree nor feature ... warn all -stand f03" when you compile with ifort and check whether you ... If you think this is a bug in gfortran, feel free to fill a bug ...
    (comp.lang.fortran)