This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: real-values print and add incorrectly (version 4.1.0 20050702,i686-pc-mingw32)
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: Tillmann Wegst <post at tillmann-wegst dot de>
- Cc: fortran at gcc dot gnu dot org
- Date: Fri, 29 Jul 2005 06:19:14 -0700
- Subject: Re: real-values print and add incorrectly (version 4.1.0 20050702,i686-pc-mingw32)
- References: <01b101c59468$43626a40$0500a8c0@Plum>
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