Currently, Clang emits false positive for
void test(void) {
static int counter = 0;
counter += 1;
}warning: variable 'counter' set but not used [-Wunused-but-set-variable]
We should check for correct local storage (a variable with function scope is a non-static local variable).