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

Bogus standard conformance warning for compiler directives

Harald
Beginner
1,231 Views
ifort produces a standard conformance warning for code like:

[bash]subroutine bogus_warning (a, n)
  implicit none
  integer :: n
  real    :: a(n)

  integer :: j
!DIR$ IVDEP
!CDIR NODEP
  DO j = 1, n
     a(j) = 0.0
  END DO
end subroutine bogus_warning
[/bash]
% ifort ifort12-warn-on-directive.f90 -c -stand
ifort12-warn-on-directive.f90(7): warning #6477: Fortran 2003 does not allow this statement or directive.
!DIR$ IVDEP
------^

(The intent of the compiler-dependent directives is to aid e.g. optimization or vectorization).

Note that the compiler directives in the source code have the
form of a Fortran comment and should IMHO be treated as such.
It would be nice if the warning would disappear.

Harald

0 Kudos
6 Replies
Steven_L_Intel1
Employee
1,231 Views
We had an extensive discussion about this in the past, and decided that directives are "funny-looking statements" and not comments, and that the warnings were appropriate.
0 Kudos
jimdempseyatthecove
Honored Contributor III
1,231 Views
Steve,

Considering that compiler directives are implementation dependent could IVF consider adding a NOWARN attribute

!DEC$ (something) NOWARN
(something else causing warning)
statement

This would satisfy both sides of the argument for/against the warning

Jim Dempsey
0 Kudos
Steven_L_Intel1
Employee
1,231 Views
Well, no, that would mean thast the NOWARN directive would need a warning!

Perhaps what is needed is a "don't give standards warnings about directives" compiler option. VAX Fortran used to have several sub-qualifiers for standards warning allowing you to exclude things such as source form (tab formatting), etc. Or, simpler, separate out warnings for directives to their own message number and then you can use -diag-disable to suppress it. I will suggest this to the team.
0 Kudos
Harald
Beginner
1,231 Views
An option to disable the particular warning would be great.

Thanks,

Harald
0 Kudos
Lorri_M_Intel
Employee
1,231 Views

Try adding the following switch to your command line:

-diag-disable 6477

-- Lorri

0 Kudos
Harald
Beginner
1,231 Views
I am now using

-diag-disable 6477,7025

to suppress the directive-related warnings.

Thanks,
Harald
0 Kudos
Reply