- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
$ ifort --version
ifort (IFORT) 12.1.3 20120212
contents of test.f90:
[fortran]program test type :: tp character(len=18) :: name = "abc" integer :: int = 3 end type tp type(tp), target :: t class(*), pointer :: x character(len=17), target :: name = "efg" x => t%name call f(x) call f(t%name) x => t%int call f(x) call f(t%int) x => name call f(x) call f(name) contains subroutine f(x) class(*) :: x select type(x) type is (character(len=*)) print '(2g0)',"char=",x type is (integer) print '(2g0)',"int=",x end select end subroutine f end program test [/fortran]
$ifort -stand f08 -o test test.f90 && ./test
[plain]char=abc char= int=3 int=3 char=efg char=efg [/plain] Note the second line where 'char=' is not followed by 'abc'.
Is such behavior compliant with Fortran 2008 standard, or is it a bug in ifort?
ifort (IFORT) 12.1.3 20120212
contents of test.f90:
[fortran]program test type :: tp character(len=18) :: name = "abc" integer :: int = 3 end type tp type(tp), target :: t class(*), pointer :: x character(len=17), target :: name = "efg" x => t%name call f(x) call f(t%name) x => t%int call f(x) call f(t%int) x => name call f(x) call f(name) contains subroutine f(x) class(*) :: x select type(x) type is (character(len=*)) print '(2g0)',"char=",x type is (integer) print '(2g0)',"int=",x end select end subroutine f end program test [/fortran]
$ifort -stand f08 -o test test.f90 && ./test
[plain]char=abc char= int=3 int=3 char=efg char=efg [/plain] Note the second line where 'char=' is not followed by 'abc'.
Is such behavior compliant with Fortran 2008 standard, or is it a bug in ifort?
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's a bug, but one that we have fixed for a version to be released later this year.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page