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: real-values print and add incorrectly (version 4.1.0 20050702,i686-pc-mingw32)


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


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