Variable initialization to numeric constant treated as global.
sample code:
#define VAL 0
union
{
typedef_struct_t tst;
uint32_t val; // for alignment
} new_struct;
new_struct.tst.a = 0;
new_struct.tst.b = VAL;
Those new_struct initialization statements increase the globals count.
Upon further investigation, it looks like alignment (extra whitespace) is the issue.
new_struct.tst.long_var_name = 0;
new_struct.tst.var_name = 0;
new_struct.tst.var2_name = VAL;
The second assignment increases the globals count.
+1 I also have a lot of false positive.
Hello!
It turns out the the way ravioli counts globals is quite naive -- and likely to be quite buggy -- and also isn't correct for the way KSF is defined.
What it needs to count are global usages not merely global definitions. This is a bit more complicated problem, but the right thing to do.
I'm currently working on improvements to global counting. When this is done, this should potentially fix a variety of issues.
I'm currently working on improvements to global counting. When this is done, this should potentially fix a variety of issues.
Great! Looking forward to it.