/check:uninit: scalars vs. arrays

/check:uninit: scalars vs. arrays

jlamls's picture

/check:uninit will correctly detect this use of uninitilized variables when scalars are used:

DOUBLE PRECISION A, B

A = 1D0/B

but it will not detect this case:

DOUBLE PRECISION A, B(1)

A = 1D0/B(1)

Is there any way to check for use of uninitialized array space? I am using IVF version 11.1.3470.2005 within Visual Studio 8.0.50727.762 (SP .050727-7600).

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Steve Lionel (Intel)'s picture

Correct - that feature works for local scalars only. You might see if the "Source Checker" feature helps.

Steve
jimdempseyatthecove's picture

>>Is there any way to check for use of uninitialized array space?

In Debug build under Windows unwritten to allocations hold 0xcacacaca....
The programmer could insert conditional compiled asserts against this value.

An alternate way is immediately after allocation of REAL/DOUBLE is to wipe the array with Signaling NaNs. If these are subsequently used you will be immediately notified. Or in the case on non-Signaling NaNs you can insert fewer asserts and hopefully trace back to the origination of the error within a few test runs.

Jim Dempsey

Blog: The Parallel Void

www.quickthreadprogramming.com

Login to leave a comment.