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

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

Hello,

the standard conformance diagnostics can sometimes be confusing.  Example:

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

%  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.   [I]
  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... :-)

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hello Harald,

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

Annalee

Leave a Comment

Please sign in to add a comment. Not a member? Join today