I am again struggling to find mistakes in my code with visual studio under windows. Now an assignment of an unallocated allocatable variable to another variable was messing up all my code and visual studio never detected the error. I lost 2 days to find it. What tool can I use that can catch errors like this? I see there are many alternative for Valgrind for Windows ( Is there a good Valgrind substitute for Windows? ), which one would you suggest for these kinda problems? thanks.
Asked
Active
Viewed 278 times
1
-
If you mean _uninitialized_ variable then you should increase your warning levels. If you mean a variable containing a null pointer value you should be checking pointers for null. – Captain Obvlious Feb 06 '14 at 00:55
-
He probably meant unallocated allocatable variable. – Vladimir F Героям слава Feb 06 '14 at 02:39
-
Yes unallocated allocatable variable I now specify it – Millemila Feb 06 '14 at 13:53
1 Answers
2
When debugging or testing, compile and run with the appropriate error checking and diagnostic options (in the project properties under Fortran > Diagnostics set Compile Time Diagnostics to "Show All (/warn:all)" and under Fortran > "Run-time" set Runtime Error Checking to "All (/check:all)".
As an observation only - the Intel Fortran compiler is sometimes sold in a bundle with another Intel product (Inspector XE) that allows more intensive memory and concurrency correctness checking. The runtime mode of this has similar capabilities to valgrind.

IanH
- 21,026
- 2
- 37
- 59
-
it was already /check:all . I will recreate the mistake in the code and I ll see if Inspector XE finds it. i let you know. – Millemila Feb 06 '14 at 13:55