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

Ifort (minor) regression: bogus warning #6750 for legal F95 code

Harald1
New Contributor II
1,204 Views

The following code produces a bogus warning when compiled with -stand=f08:

program p
  implicit none
  integer,  parameter :: wp   = selected_real_kind (6)
  real(wp), parameter :: x(1) = huge (0._wp)
  real(wp)            :: y(1) = huge (0._wp)
  real(wp)            :: z(1) = huge (0.0)
end

E..g.: ifort 2021.6.0 / ifx 2022.1.0:

% ifort ifort-init.f90 -stand=f08
ifort-init.f90(4): warning #6750: F2008 does not allow an initialization expression which includes a specification inquiry of a type parameter / an array bound can not be within the same entity-decl.   [X]
  real(wp), parameter :: x(1) = huge (0._wp)
-------------------------^
ifort-init.f90(5): warning #6750: F2008 does not allow an initialization expression which includes a specification inquiry of a type parameter / an array bound can not be within the same entity-decl.   [Y]
  real(wp)            :: y(1) = huge (0._wp)
-------------------------^
ifort-init.f90(6): warning #6750: F2008 does not allow an initialization expression which includes a specification inquiry of a type parameter / an array bound can not be within the same entity-decl.   [Z]
  real(wp)            :: z(1) = huge (0.0)
-------------------------^

To the best of my knowledge this is valid F95 and accepted by NAG and others.  No warning for -stand=f18.  The warning does not really make sense to me.

Ifort 16.0.8.266 was silent; ifort 17.0.2.174 and newer releases show the above warning.

 

0 Kudos
4 Replies
Steve_Lionel
Honored Contributor III
1,184 Views

I agree.

0 Kudos
Barbara_P_Intel
Employee
1,135 Views

I filed a bug report on this, CMPLRIL0-34763. I'll let you know when it's fixed.



0 Kudos
Lionel_Guez
Beginner
1,012 Views

Hello. The same wrong warning occurs with `-stand f03`.

0 Kudos
Barbara_P_Intel
Employee
841 Views

The bogus error message is removed now in the latest release of ifort and ifx in oneAPI HPC Toolkit 2023.1. It's gone for -stand=[f03|f08|f18].

Please install the compiler. It was released just this week.



0 Kudos
Reply