- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Theversion 11 of Intel fortran compiler not execute the code above whenckeck bounds and routine interface options are activated.
In my case, it is not an error.
In old version, it was possible have bounds check without error.
What option can i use to run this program having check bpunds active.
Thank you,
Marcos
program test
implicit none
character*4 array_char_name(3*12)
array_char_name=''
! asssign values
call test_subroutin(array_char_name)
call print_read_values(array_char_name)
pause
stop
end
subroutine test_subroutin(names)
implicit none
character*12 names(3)
names(1)='one_xxxxxxxx'
names(2)='two_xxxxxxxx'
names(3)='tre_xxxxxxxx'
return
end
subroutine print_read_values(names)
implicit none
character*12 names(3)
write(*,*) names
return
end
In my case, it is not an error.
In old version, it was possible have bounds check without error.
What option can i use to run this program having check bpunds active.
Thank you,
Marcos
program test
implicit none
character*4 array_char_name(3*12)
array_char_name=''
! asssign values
call test_subroutin(array_char_name)
call print_read_values(array_char_name)
pause
stop
end
subroutine test_subroutin(names)
implicit none
character*12 names(3)
names(1)='one_xxxxxxxx'
names(2)='two_xxxxxxxx'
names(3)='tre_xxxxxxxx'
return
end
subroutine print_read_values(names)
implicit none
character*12 names(3)
write(*,*) names
return
end
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think this is a compiler bug. If the argument was a scalar, it would be required that the length of the dummy argument be equal to or less than that of the actual argument, and the compiler now checks that. But it incorrectly does this check when the dummy argument is an array, where the only requirement is that the total length of the dummy can't exceed that of the actual, which it doesn't in your case. What's worse is that both generated interface checking and run-time bounds checking get this wrong.
I'll report this to the developers. The issue ID is DPD200139004. A workaround is to declare a second variable that is character*12 and EQUIVALENCE it to the CHARACTER*4 variable, passing the *12 variable, like this:
character*4 array_char_name(3*12)
character*12 array2(3*4)
equivalence (array_char_name, array2)
array_char_name=''
! asssign values
call test_subroutin(array2)
I'll report this to the developers. The issue ID is DPD200139004. A workaround is to declare a second variable that is character*12 and EQUIVALENCE it to the CHARACTER*4 variable, passing the *12 variable, like this:
character*4 array_char_name(3*12)
character*12 array2(3*4)
equivalence (array_char_name, array2)
array_char_name=''
! asssign values
call test_subroutin(array2)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am told that this bug is fixed - the fix should appear in Update 3.

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