gfortran diagnostics and so on
- From: "James Van Buskirk" <not_valid@xxxxxxxxxxx>
- Date: Thu, 22 Nov 2007 13:17:07 -0700
While the issue has been raised about diagnostics and features that
cost the programmer time, I thought I would point out a few that I
have been bitten by lately with gfortran.
C:\gfortran\clf\bugs>C:\gfortran\win64\bin\x86_64-pc-mingw32-gfortran -v
Using built-in specs.
Target: x86_64-pc-mingw32
Configured with:
.../trunk/configure --prefix=/home/FX/win64 --with-sysroot=/home
/FX/win64 --build=i386-pc-mingw32 --target=x86_64-pc-mingw32 --enable-languages=
c,fortran --with-gmp=/home/FX/local --disable-werror --disable-nls --enable-thre
ads=win32
Thread model: win32
gcc version 4.3.0 20070920 (experimental) [trunk revision 128387] (GCC)
C:\gfortran\clf\bugs>type bug1_backslash.f90
! File: bug1_backslash.f90
! Public domain 2007 James Van Buskirk
program bug1_backslash
implicit none
write(*,'(a)') 'C:\windows\bug1'
end program bug1_backslash
! End of file: bug1_backslash.f90
C:\gfortran\clf\bugs>C:\gfortran\win64\bin\x86_64-pc-mingw32-gfortran
bug1_backs
lash.f90 -obug1_backslash
C:\gfortran\clf\bugs>bug1_backslash
C:\windowug1
C:\gfortran\clf\bugs>C:\gfortran\win64\bin\x86_64-pc-mingw32-gfortran
bug1_backs
lash.f90 -fno-backslash -obug1_backslash
C:\gfortran\clf\bugs>bug1_backslash
C:\windows\bug1
C:\gfortran\clf\bugs>type bug2_transfer.f90
! File: bug2_transfer.f90
! Public domain 2007 James Van Buskirk
program bug2_transfer
use ISO_C_BINDING
implicit none
type(C_PTR) C_NULL_PTR1
C_NULL_PTR1 = transfer(0_C_INTPTR_T,C_NULL_PTR1)
write(*,'(a)') trim(merge('.TRUE. ','.FALSE.', &
C_ASSOCIATED(C_NULL_PTR1)))
end program bug2_transfer
! End of file: bug2_transfer.f90
C:\gfortran\clf\bugs>C:\gfortran\win64\bin\x86_64-pc-mingw32-gfortran
bug2_trans
fer.f90 -obug2_transfer
bug2_transfer.f90:0: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
C:\gfortran\clf\bugs>type bug3_structure_constructor.f90
! File: bug3_structure_constructor.f90
! Public domain 2007 James Van Buskirk
module bug3_mod
use ISO_C_BINDING
implicit none
private
public bug3
type bug3
integer(C_INT) n
type(C_PTR) p
character(kind=C_CHAR) c
end type bug3
end module bug3_mod
program bug3_structure_constructor
use ISO_C_BINDING
use bug3_mod
implicit none
type(bug3) result
result = bug3( &
17, & ! n
C_NULL_PTR, & ! p -- errors here
C_NULL_PTR ) ! c -- should error here
end program bug3_structure_constructor
! End of file: bug3_structure_constructor.f90
C:\gfortran\clf\bugs>C:\gfortran\win64\bin\x86_64-pc-mingw32-gfortran
bug3_struc
ture_constructor.f90 -obug3_structure_constructor
bug3_structure_constructor.f90:24.17:
C_NULL_PTR, & ! p -- errors here
1
Error: Can't convert TYPE(c_ptr) to CHARACTER(1) at (1)
C:\gfortran\clf\bugs>type bug4_structure.f90
! File: bug4_structure.f90
! Public domain 2007 James Van Buskirk
module bug4_mod
implicit none
type bug4
! Intentionally left blank; should error up here
end type bug4
end module bug4_mod
program bug4_structure
use bug4_mod
implicit none
type(bug4) t
t = bug4()
write(*,*) t
end program bug4_structure
! End of file: bug4_structure.f90
C:\gfortran\clf\bugs>C:\gfortran\win64\bin\x86_64-pc-mingw32-gfortran
bug4_struc
ture.f90 -obug4_structure
bug4_structure.f90:13.13:
type(bug4) t
1
Error: Derived type 'bug4' at (1) is being used before it is defined
bug4_structure.f90:15.11:
t = bug4()
1
Error: Derived type 'bug4' at (1) is being used before it is defined
bug4_structure.f90:16.15:
write(*,*) t
1
Error: Symbol 't' at (1) has no IMPLICIT type
--
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end
.
- Follow-Ups:
- Re: gfortran diagnostics and so on
- From: Tobias Burnus
- Re: gfortran diagnostics and so on
- From: Tobias Burnus
- Re: gfortran diagnostics and so on
- Prev by Date: Programming with tied hands
- Next by Date: Re: Programming with tied hands
- Previous by thread: Programming with tied hands
- Next by thread: Re: gfortran diagnostics and so on
- Index(es):