Re: Detecting Reads of Global Uninitialized Variables
- From: "Mike Wahler" <mkwahler@xxxxxxxxxxxx>
- Date: Thu, 29 Sep 2005 23:25:03 GMT
<jyu.james@xxxxxxxxx> wrote in message
news:1128034028.587595.231600@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> I'm trying to detect reads of uninitialized global variables (that are
> declared in one file, and used in another as an extern).
>
> I know that ANSI C initializes all global variables to 0, however, I do
> not want to rely on this for initialization.
Why not? The language guarantees it.
> Instead, I want to
> explicity initialize all variables myself. I've looked at tools like
> Compuware BoundsChecker, which does an amazing job in detecting
> uninitialized variables, but doesn't detect reads of GLOBAL
> uninitialized variables.
That's because they *are* initialized.
>
> Is there a tool out there that can do this? Or is there a particular
> technique that can be used to automate this?
You'll need some kind of C parser.
-Mike
.
- Follow-Ups:
- Re: Detecting Reads of Global Uninitialized Variables
- From: Alexei A. Frounze
- Re: Detecting Reads of Global Uninitialized Variables
- Prev by Date: Re: RAND between 0 and 1
- Next by Date: Re: I think I'm gonna cry. (or newby problems with simple string function)
- Previous by thread: Re: I think I'm gonna cry. (or newby problems with simple string function)
- Next by thread: Re: Detecting Reads of Global Uninitialized Variables
- Index(es):
Relevant Pages
|