jfh
unread,Jul 31, 2012, 9:43:21 PM7/31/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to gg...@googlegroups.com
The following program appears to expose a bug in g95 0.93. A workaround is to insert a statement saying
intrinsic huge
in the module. Without it, g95 fails to realise that big is generic. The program compiles as is and runs happily with gfortran, nagfor and Sun f95. The problem is caused by huge being renamed big when the module is used.
cayley[~/Jfh] % cat testonly6.f90
module bla
integer :: i=huge(1)
end module bla
program test
use bla, only: i, big => huge
print*, i, big(1),big(1.0),big(1d0)
end program test
cayley[~/Jfh] % g95 testonly6.f90
In file testonly6.f90:6
print*, i, big(1),big(1.0),big(1d0)
2 1
Warning (155): Inconsistent types (REAL(8)/REAL(4)) in actual argument lists at (1) and (2)
In file testonly6.f90:6
print*, i, big(1),big(1.0),big(1d0)
2 1
Warning (155): Inconsistent types (REAL(8)/INTEGER(4)) in actual argument lists at (1) and (2)
/tmp/ccgPoa3M.o: In function `MAIN_':
testonly6.f90:(.text+0x77): undefined reference to `_g95_huge'
testonly6.f90:(.text+0xa6): undefined reference to `_g95_huge'
testonly6.f90:(.text+0xd2): undefined reference to `_g95_huge'
cayley[~/Jfh] %
-- JFH