Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

Missing warning for dummy argument with an explicit INTENT(OUT) being used before it is defined.

$
0
0

Consider the following simple code snippet.  Intel Fortran does give a warning if the procedure does not give a value to a dummy argument with an explicit INTENT(OUT) attribute.  However a warning if such a variable is used before being defined is missing; it'll be very helpful if the compiler can warn for this situation as well.

module m

   implicit none

contains

   subroutine foo(i)

      integer, intent(out) :: i

      print *, i

      return

   end subroutine foo

   subroutine bar(i)

      integer, intent(out)  :: i

      print *, i

      i = 1

      return

   end subroutine bar

end module m
Compiling with Intel(R) Visual Fortran Compiler XE 15.0.3.208 [Intel(R) 64]...
m.f90
C:\..\m.f90(7): warning #6843: A dummy argument with an explicit INTENT(OUT) declaration is not given an explicit value.   [I]

Build log written to  "file://C:\..\temp\Release\x64\p_BuildLog.htm"
p - 0 error(s), 1 warning(s)

 


Viewing all articles
Browse latest Browse all 3270

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>