The only way to get warnings for uninitalized non-local variables is by
using annotations (/*@globals undef a@*/).  In the example you have, its
simple enough to do a flow analysis to see that a is used before it is
initialized, but in general doing that type of global flow analysis is
expensive.

--- Dave

On Tue, 13 Aug 2002, Massimiliano Cialdi wrote:

> I need to search for uninitialized variables in a not-instrumented
> source code (w/o annotations). No problem with local (automatic)
> variables but I don't know how to analize global variables.
>
> for example:
>
> ------------------------------
> static int a;
>
> static void s()
> {
>   if(a==34) a=33;
> }
>
> int main(void)
> {
>   int r;
>   if(r==66) r = 65;
>   s();
>   return 0;
> }
> --------------------
> in this case splint only report "Variable r used before definition", but
> nothing about a.
>
> thanks
> --
> Massimiliano Cialdi
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>

Reply via email to