Re: Detecting Reads of Global Uninitialized Variables
- From: junky_fellow@xxxxxxxxxxx
- Date: 29 Sep 2005 22:29:25 -0700
jyu.james@xxxxxxxxx wrote:
> 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. 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.
>
> Is there a tool out there that can do this? Or is there a particular
> technique that can be used to automate this?
The best solution will be to find all such uninitialized global
variables
using some tool (like cscope) and initialize them appropriately
depending on their types.
.
- Follow-Ups:
- Re: Detecting Reads of Global Uninitialized Variables
- From: jyu.james@xxxxxxxxx
- Re: Detecting Reads of Global Uninitialized Variables
- Prev by Date: Re: K&R Wishlist
- Next by Date: Re: Global variables
- Previous by thread: Re: Detecting Reads of Global Uninitialized Variables
- Next by thread: Re: Detecting Reads of Global Uninitialized Variables
- Index(es):
Relevant Pages
|