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

Run-Time Check Failure #3

Les_Neilson
Valued Contributor II
473 Views
Code:
program main

   integer*4 :: jnum(10)
   integer*4 :: i
   integer*4 :: j
   integer*4 :: k


   do i=1,10
      jnum(i) = i
   enddo 

   j = 8

   k = maxval(minloc(jnum, MASK=jnum.eq.j))

   write(*,*) "k =", k
end

Produces four messages :

Run-Time Check Failure #3 - The variable '' is being used without being defined.

I know I can just do

k=maxval(jnum, MASK=jnum.eq.j)

but I waslooking at acode snippet of an algorithmand came across this in the process.

Can anyone explain what's wrong with the code as shown?

thanks

Les

0 Kudos
1 Reply
Steven_L_Intel1
Employee
473 Views
You didn't mention that you are using /check:uninit

You've encountered two compiler bugs:

1. The variable name does not get properly reported
2. This code should not have reported an error at all

Both will be fixed as of the mid-late February update. This update will also make /check:uninit work in contexts other than running under the VS debugger.
0 Kudos
Reply