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

f90 compatibility of compiler directive

billaustralia
Beginner
525 Views
with ivf compiling with the Property Page Fortran Diagnostics
Warn For Non-standard Fortran
set to
Fortran 90
I get a warning for every compiler directive eg
!DEC$ENDIF
produces
SGRUN.FOR(14) : Warning: This directive is not standard F90.
I have a thousand or so.
How can I supress them and still get the other non f90 warnings?
0 Kudos
3 Replies
Steven_L_Intel1
Employee
525 Views
You can't. We're discussing a possible future feature that would give you that control. But, think about it - your code isn't standard F90 if it has directives, which are just statements spelled in a funny way.

You could consider using the fpp preprocessor and I think you would not get standards warnings for that. You'd have to change the !DEC$ IF to #if, etc.
0 Kudos
durisinm
Novice
525 Views
Why would IVF--or any Fortran compiler--complain about statements beginning with ! followed by characters? Isn't that a valid Fortran 90 comment?
Mike D.
0 Kudos
Steven_L_Intel1
Employee
525 Views
It is to a compiler that doesn't recognize the directive, yes. That's the motivation for the directive design.

But for a compiler that DOES recognize them, they are statements. We had a long and drawn-out debate about this a few years ago. I originally took the view that they were comments, but when it was pointed out to me that directives change the semantics of a program, I changed my mind.

You ask for standards checking to make sure you aren't using any constructs that may be non-portable. Directives fall into this category. Your program may require directives to work the way you want, so you should be warned about them.
0 Kudos
Reply