[Bug fortran/18566] New: Can vary constants

Thomas dot Koenig at online dot de gcc-bugzilla@gcc.gnu.org
Fri Nov 19 13:23:00 GMT 2004


Should the value of pi change...

The following is very probably illegal code.
Still, it would be nice if this could segfault
instead of silently doing the Wrong Thing.

$ cat variation-constants.f90
module a1
contains
  subroutine foo(b)
    real :: b
    b = 42.
  end subroutine foo
end module a1

program main
  use a1
  real, parameter :: pi = 3.1415926535
  call foo(pi)
  print *,'pi equals ', pi
end program main
$ gfortran variation-constants.f90 && ./a.out
 pi equals    42.00000
$ gfortran -v
Reading specs from /home/zfkts/lib/gcc/ia64-unknown-linux-gnu/4.0.0/specs
Configured with: ../gcc-4.0-20041107/configure --prefix=/home/zfkts
--enable-languages=c,c++,f95
Thread model: posix
gcc version 4.0.0 20041107 (experimental)

-- 
           Summary: Can vary constants
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Thomas dot Koenig at online dot de
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18566



More information about the Gcc-bugs mailing list