下面是一些示例代码:为什么ifort - 在接口不匹配时抛出所有抛出错误?
! Author: Svetlana Tkachenko [email protected]
! License: GPLv3 or later
subroutine myprint(var)
! integer :: var
! print *, 'Hi, my ', var
end subroutine
module testing
type triangle
integer :: point(3)
end type
end module
program main
use testing
type(triangle) :: mytriangle
mytriangle%point(1)=5
call myprint(mytriangle%point(1))
end program
它正常工作与ifort -c file.f90
,但ifort -warn all -c file.f90
导致错误:
blah.f90(4): warning #6717: This name has not been given an explicit type. [VAR]
subroutine myprint(var)
-------------------^
blah.f90(4): remark #7712: This variable has not been used. [VAR]
subroutine myprint(var)
-------------------^
blah.f90(19): error #6633: The type of the actual argument differs from the type of the dummy argument. [POINT]
call myprint(mytriangle%point(1))
---------------------------^
compilation aborted for blah.f90 (code 1)
为什么-warn all
抛出一个错误?该手册页特别说明all
不包括错误。
我知道我只能修复代码,但我正在尝试为遗留代码库设置测试套件,并且希望能够在开始进行代码更改之前运行带有警告的编译测试。
您可以(应该)在实际支持论坛上询问供应商,了解其具体行为的原因。 –
我只是假设你知道'var'在子程序中隐含地是'real' ... –