- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
For me one of the most important features of a debugger is, that the debugger breaks on uninitialized variables. In my IVF properties I have chosen: Runtime Error Checking: All, so that includes checking for uninitialized variables. But to my surprise the debugger does not break on statements withuninitialized variables, but simply assigns value zero toall uninitialized variables, and continues without giving any warning.
Any idea how to force the debugger to really break onstatements including uninitialized variables ?
Many thanks,
Antoon
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you do not get an error for an uninitialized variable, then the compiler is failing to detect it. The uninitialized variable detection has some significant gaps. Can you show a small test case that fails to detect the error?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you do not get an error for an uninitialized variable, then the compiler is failing to detect it. The uninitialized variable detection has some significant gaps. Can you show a small test case that fails to detect the error?
I tried to reproduce this problem in a small program, but then the debugger indeed breaks on uninitialized variables.
In my much more complex software package (100 modules) where the problem occurs, I see in the watch windows that all uninitialized variables are set on zero, andall dynam. allocated arrays are set on value -1.3270393E-03, does that ringa bell ?
My command line parameters (from the Property pages) are:
/nologo /Zi /Od /include:"....include" /extend_source:132 /error_limit:500 /warn:all /module:"....include"
/object:"Debug" /traceback /check:all /libs:static /threads /dbglibs /c
Does that help, anything strange ??
Many thanks !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you do not get an error for an uninitialized variable, then the compiler is failing to detect it. The uninitialized variable detection has some significant gaps. Can you show a small test case that fails to detect the error?
I tried to reproduce this problem in a small program, but then the debugger indeed breaks on uninitialized variables.
In my much more complex software package (100 modules) where the problem occurs, I see in the watch windows that all uninitialized variables are set on zero, andall dynam. allocated arrays are set on value -1.3270393E-03, does that ringa bell ?
My command line parameters (from the Property pages) are:
/nologo /Zi /Od /include:"....include" /extend_source:132 /error_limit:500 /warn:all /module:"....include"
/object:"Debug" /traceback /check:all /libs:static /threads /dbglibs /c
Does that help, anything strange ??
Many thanks !
what you have specified is absolutely correct. But I suggest you to configure it exactly as requiredinstead of doing it like /check:all that you are doing. So, try this option to find the uninitialised variables especially using /check:uninit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The value that happens to be in memory on allocated arrays is just accidental. The uninitialized variable checking does not rely on special values. It also does not work on arrays.

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