/check:uninit: scalars vs. arrays

/check:uninit: scalars vs. arrays

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


A = 1D0/B

but it will not detect this case:


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.

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

Retired 12/31/2016

>>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


Leave a Comment

Please sign in to add a comment. Not a member? Join today