473,385 Members | 1,587 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Run-Time Check Failure #3

Hi,

MSVC 7.1 .net 2003, native c++. I received this runtime message today for
the first time in my life (and I've used MSVC for a long time):

Run-Time Check Failure #3 - The variable 'doCancel' is being used without
being defined.

The word "defined" should say "initialized". The code that triggered it
looked a little like this:
bool doCancel; // uninitialized
if(doCancel) // use of uninitialized
...

My question:

I've used hundreds of uninitialized variables in the past few years. Most
of them I found only while searching for strange runtime behavior. How come
MSVC never popped up this very helpful warning before?

I run debug all the time, so the answer is not "because I've always run in
release mode."

Thanks,

Chris
Mar 7 '06 #1
2 5888
"Chris Stankevitz" <ch******@stankevitz.nospamplease.com> wrote in message
news:e1**************@TK2MSFTNGP09.phx.gbl...
I've used hundreds of uninitialized variables in the past few years. Most
of them I found only while searching for strange runtime behavior. How
come MSVC never popped up this very helpful warning before?

I run debug all the time, so the answer is not "because I've always run in
release mode."


One of the primary techniques that malware/spyware/virus writers use to
inflict pain is to mess up the stack.

At about the time that viruses started making the evening news, the compiler
was modified to detect the buffer overruns and whatnot that play havoc with
the stack. I might be wrong, but I think that the uninitialized automatic
variable checks were added at the same time.

Just by the way, and on a slightly tangential note, Brandon Bray of the VC++
compiler team has an article about some of the newer checks performed by the
compiler here:

http://www.codeproject.com/tips/seccheck.asp

Regards,
Will
Mar 7 '06 #2
"William DePalo [MVP VC++]" <wi***********@mvps.org> wrote
Just by the way, and on a slightly tangential note, Brandon Bray of the
VC++ compiler team has an article about some of the newer checks performed
by the compiler here:

Will,

Thanks for the help. I just enabled the run time checks on all the "vcproj"
in my "sln" for debug.

Chris


Mar 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ed | last post by:
Hello, I took a course in asp about 2 years ago and I was practicing with IIS 5.0. Then I put it down for a while. Now trying to get back to it. I can't run asp files from subdirectories of...
4
by: Primo | last post by:
Hi, This problem has been frustrating me for days and I hope you experts can help me out. I am trying to run a command, which I would normally run from the command line, from within my C#...
6
by: orekin | last post by:
Hi There I have been trying to come to grips with Application.Run(), Application.Exit() and the Message Pump and I would really appreciate some feedback on the following questions .. There are...
13
by: Bob Day | last post by:
Using vs2003, vb.net I start a thread, giving it a name before start. Code snippet: 'give each thread a unique name (for later identification) Trunk_Thread.Name = "Trunk_0_Thread" ' allow...
3
by: emman_54 | last post by:
Hi every one, I am trying to run a batch file using my asp.net application. I am using the Process class to run the batch file. When I run my web application, In the task manager, i could see...
19
by: Bryan | last post by:
How can i run a bit of code straight from the IDE? Right now i make a temporary button and put the code behind that, then i run debug mode and click on the button. Is there a way to highlight...
9
by: Brett Wesoloski | last post by:
I am new to VS2005. I changed my program.cs file to be a different form I am working on. But when I go to run the application it still brings up the form that was originally declared as new. ...
7
by: Lee Crabtree | last post by:
I remember when I was first getting into .NET Forms programming that there was a rather emphatic rule about not constructing a form before calling Application.Run with it. So this: ...
8
by: David Thielen | last post by:
Hi; In our setup program how do I determine if I need to run "aspnet_regiis –i" and if so, is there an API I can calll rather than finding that program on the user's disk and calling it? --...
3
by: traceable1 | last post by:
Is there a way I can set up a SQL script to run when the instance starts up? SQL Server 2005 SP2 thanks!
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.