- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page