主题:[讨论]interface中定义输入的是未知长度的字符,debug出错
使用外部子程序时出错,错误如下
error #8000: There is a conflict between local interface block and external interface block. [MY_TRIM]
说我my_trim()中的字符串与interface中定义不符。interface中定义输入的是未知长度的字符,为何会debug出错
但是release却可以输出结果,用cvf的话debug不出错。这是编译器的原因吗?小弟用的是ivf
程序如下:
program exam8
implicit none
interface
function my_trim(char)
implicit none
character(*):: char
character(len_trim(adjustl(char))):: my_trim
end
end interface
print *, my_trim(' 5678 ')
end program exam8
function my_trim(char)
implicit none
character(*):: char
character(len_trim(adjustl(char))):: my_trim
my_trim = trim(adjustl(char))
end
error #8000: There is a conflict between local interface block and external interface block. [MY_TRIM]
说我my_trim()中的字符串与interface中定义不符。interface中定义输入的是未知长度的字符,为何会debug出错
但是release却可以输出结果,用cvf的话debug不出错。这是编译器的原因吗?小弟用的是ivf
程序如下:
program exam8
implicit none
interface
function my_trim(char)
implicit none
character(*):: char
character(len_trim(adjustl(char))):: my_trim
end
end interface
print *, my_trim(' 5678 ')
end program exam8
function my_trim(char)
implicit none
character(*):: char
character(len_trim(adjustl(char))):: my_trim
my_trim = trim(adjustl(char))
end