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 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

Hello Harald,

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

Annalee

Lascia un commento

Eseguire l'accesso per aggiungere un commento. Non siete membri? Iscriviti oggi