- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hi!
I have a problem with the character length check and optional variables (ifort 11.1.056). Maybe someone can help me with this problem....
With the code:
!-------------------- test.f90
If I compile with : ifort -g -check all -o test test.f90
the result is:
forrtl: severe (408): fort: (18): Dummy character variable 'STRING2' has length 20 which is greater then actual variable length 0
Image PC Routine Line Source
test_chars 000000000047140D Unknown Unknown Unknown
test_chars 000000000046FF15 Unknown Unknown Unknown
test_chars 00000000004215F9 Unknown Unknown Unknown
test_chars 000000000040401F Unknown Unknown Unknown
test_chars 0000000000404422 Unknown Unknown Unknown
test_chars 0000000000402C32 Unknown Unknown Unknown
test_chars 0000000000402B7B Unknown Unknown Unknown
test_chars 0000000000402AFC Unknown Unknown Unknown
libc.so.6 00007F0BA4FF1466 Unknown Unknown Unknown
test_chars 0000000000402A29 Unknown Unknown Unknown
If I just use : ifort -g -o test test.f90, the results its OK.
Thanks
I have a problem with the character length check and optional variables (ifort 11.1.056). Maybe someone can help me with this problem....
With the code:
!-------------------- test.f90
[cpp]module strings!-----------------------------------
public
integer, parameter :: namesize = 20
end module strings
program test
character(30) :: string1, string2
interface
subroutine sub_chars_1(string1,string2)
use strings
character(namesize), optional, intent(in) :: string1
character(namesize), optional, intent(in) :: string2
end subroutine sub_chars_1
end interface
string1 = ' this is string 1'
string2 = ' this is string 2'
call sub_chars_1(string1=string1)
end program test
subroutine sub_chars_1(string1,string2)
use strings
character(namesize), optional, intent(in) :: string1
character(namesize), optional, intent(in) :: string2
interface
subroutine sub_chars_2(string1,string2)
use strings
character(namesize), optional, intent(in) :: string1
character(namesize), optional, intent(in) :: string2
end subroutine sub_chars_2
end interface
call sub_chars_2(string1,string2)
end subroutine sub_chars_1
subroutine sub_chars_2(string1,string2)
use strings
character(namesize), optional, intent(in) :: string1
character(namesize), optional, intent(in) :: string2
if(present(string1)) print*,' String 1 :',trim(string1)
if(present(string2)) print*,' String 2 :',trim(string2)
end subroutine sub_chars_2[/cpp]
If I compile with : ifort -g -check all -o test test.f90
the result is:
forrtl: severe (408): fort: (18): Dummy character variable 'STRING2' has length 20 which is greater then actual variable length 0
Image PC Routine Line Source
test_chars 000000000047140D Unknown Unknown Unknown
test_chars 000000000046FF15 Unknown Unknown Unknown
test_chars 00000000004215F9 Unknown Unknown Unknown
test_chars 000000000040401F Unknown Unknown Unknown
test_chars 0000000000404422 Unknown Unknown Unknown
test_chars 0000000000402C32 Unknown Unknown Unknown
test_chars 0000000000402B7B Unknown Unknown Unknown
test_chars 0000000000402AFC Unknown Unknown Unknown
libc.so.6 00007F0BA4FF1466 Unknown Unknown Unknown
test_chars 0000000000402A29 Unknown Unknown Unknown
If I just use : ifort -g -o test test.f90, the results its OK.
Thanks
Link kopiert
4 Antworten
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
This is a compiler bug that was previously reported - the issue ID is DPD200140203.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Thanks Steve.
Do you know when will be available the next update of the ifort?
Do you know when will be available the next update of the ifort?
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
The next update is scheduled for late October, but the fix for this bug is unlikely to be in that. It should be in the next one (Update 4), which I think is planned for late November.
This error occurs only if you use a fixed length in the subroutine's declaration of the argument. I recommend using CHARACTER(*) instead - this is less error prone and will avoid this bug.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
This issue is resolved in Update 4, available now.
Antworten
Themen-Optionen
- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite