int foo() {
   int x,y,z;
   x=12;
   y=17;
   ...     // a series assignments to x and y
           // no assignments are made to z
   if (y>x)
           x=1;
   else
           x=3;
   if (x>2)
           z=0;
   return z;
}

Example 1: Lint-like tools find the bug.

Back to Article