real-values print and add incorrectly (version 4.1.0 20050702, i686-pc-mingw32)

Jerry DeLisle jvdelisle@verizon.net
Fri Jul 29 20:19:00 GMT 2005


Tillmann Wegst wrote:
> Hi all,
> I'd like to report what looks like a bug in gfortran for Windows, 
> version: "GNU F95 version 4.1.0 20050702 (experimental) (i686-pc-mingw32)"
> 
> It concerns values of type real, which both print and add incorrectly.
> To give an example, take this little program:
> ------------------------------------------------
> program realtrouble
>   real :: x
>   integer :: i
> 
>   x=1.0
>   i=5
> 
>   write(*,*) "x==",x     ! Prints 0.0 instead of 1.0 !!!   write(*,*) 
> "x==",1.0  ! Prints 0.0 too !!!   write(*,*) "i==",i        ! Prints 5, 
> as expected
> end program realtrouble
> ------------------------------------------------------
Works for me on i686-pc-linux-gnu:

cat trouble.f
program realtrouble
   real :: x
   integer :: i

   x=1.0
   i=5

   write(*,*) "x==",x     ! Prints 0.0 instead of 1.0 !!!
   write(*,*) "x==",1.0  ! Prints 0.0 too !!!
   write(*,*) "i==",i        ! Prints 5, as expected
end program realtrouble

$ gfc -ffree-form trouble.f
$ ./a.out
  x==   1.000000
  x==   1.000000
  i==           5

I have a windows box.  I will see if I can confirm this problem there.

Jerry



More information about the Fortran mailing list