Re: Detecting Reads of Global Uninitialized Variables



<jyu.james@xxxxxxxxx> wrote in message
news:1128090938.862382.28220@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Well, the problem is that I expect my code to actually initialize all
> the global variables. I want to make sure that I'm not missing any
> initializations. I don't want to just go and add artificial
> initializations. Basically, I'm just trying to verify that the
> existing code does initialize all the variables (before reading from
> them).
>
> Any suggestions for that?

Put all those variables into a structure, memset() it to 0. That must make
your code deterministic, even if there must have been something else but 0
in some variable(s).

Alex


.



Relevant Pages

  • Re: [S390] cio: kernel stack overflow.
    ... Unless I'm missing something, it looks to ... me like this diff causes a change in the semantics of the code. ... I'm not sure how gcc ... I don't know whether gcc actually promises to initialize to ...
    (Linux-Kernel)
  • Re: function slow in query
    ... query logic *might* be smart enough to only read it once; ... Another way to do it would be to have your form initialize a global variable ... Public Function FiscalYear(ByVal TableDate) As Integer ... I realized later that the function was missing a bit of information and I ...
    (microsoft.public.access.modulesdaovba)
  • Re: Newbie questions
    ... I must be missing something (or the manual I'm looking at ... >The commented part will not compile on my machine. ... >means that I cannot actually initialize variables in structures, ... When the curly brace is the boundary for a block or compound ...
    (comp.lang.c)
  • Re: Calling Still Image API in C#
    ... You seem to be missing the first method, Initialize(). ... Mattias Sjögren [MVP] mattias @ mvps.org ...
    (microsoft.public.dotnet.framework.interop)
  • Re: Detecting Reads of Global Uninitialized Variables
    ... the problem is that I expect my code to actually initialize all ... the global variables. ... I want to make sure that I'm not missing any ... Prev by Date: ...
    (comp.lang.c)