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

uninit check failed

SCHWOERTZIG_T_
Beginner
733 Views

Hi,

I am wondering why uninit check does not detect uninit variable in the following program. Is there a way to detect such situations ?

       PROGRAM UNINIT_FAILED
       IMPLICIT NONE
       INTEGER VAR
         CALL DO_NOTHING(VAR)
         VAR=VAR+0
         print *, "VAR=", VAR
       END
 
       SUBROUTINE DO_NOTHING(MYVAR)
       IMPLICIT NONE
       INTEGER MYVAR
         RETURN
       END

Thank you very much for your help.

Thierry

0 Kudos
2 Replies
Steven_L_Intel1
Employee
733 Views
The compiler's run-time uninitialized variable checking is quite limited, unfortunately. It checks static, local scalars only and does not do cross-routine checking. Your error would be caught by the Static Analysis feature of Intel Fortran Studio XE, however. capture.png
0 Kudos
SCHWOERTZIG_T_
Beginner
733 Views
Thank you very much for your help. Thierry
0 Kudos
Reply