Why won't Splint warn about "variable reassigned before used"?

64 views Asked by At

Here's the code

int main(){
    int a=1;
    a=2;
    a=3;
    return a;
}

I checked the code with splint and it says "no warnings". Actually, a is reassigned 3 before the old value 2 is used. This may sign a potential defect.

What command-line arguments should I pass to find the flaw, or splint just ignores the problem?

0

There are 0 answers