Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29331 Discussions

Diagnostics of kind mismatches of intrinsics (e.g. MIN) could be improved

Harald
Beginner
430 Views

Hello,

the standard conformance diagnostics can sometimes be confusing.  Example:

[fortran]

subroutine foo (i, k, m)
  integer    :: k  
  integer(1) :: i, m(3)
  k = min (k, i)           ! Useful    warning
  k = min (k, maxval (m))  ! Confusing warning
end subroutine foo
[/fortran]

%  ifort ifort-confusing.f90 -stand -c
ifort-confusing.f90(4): warning #7374: F2003 standard requires all arguments be of the same type and same kind type parameter.  
  k = min (k, i)           ! Useful    warning
--------------^
ifort-confusing.f90(5): warning #7374: F2003 standard requires all arguments be of the same type and same kind type parameter.   [MAXVAL]
  k = min (k, maxval (m))  ! Confusing warning
--------------^

(a) One might mention the name of the intrinsic affected (here: MIN);

(b) MAXVAL is not the problem, it just happens to be used in the code... :-)

0 Kudos
1 Reply
Anonymous66
Valued Contributor I
430 Views

Hello Harald,

I have filed a feature request to improve the diagnostic mesage for this case. The issue number is DPD200243638

Annalee

0 Kudos
Reply