We've started using Cppcheck recently and everything is working great except scopes.
I might have misunderstood something but aren't there supposed to be separate scopes for enums, structs, unions etc. in the resulted .dump file after parsing ?
I was expecting there would be based in the cppcheck documentation ("ScopeType" enumerate) and the misra_8_12 rule.
Header file parsed as an example :
enum week {
LOW = 1,
MEDIUM,
HIGH
};
void testfct(void)
{
enum week day;
}
The only scopes I get as a result are a "global" scope, and a "function" scope for the testfct function. Shouldn't I get a scope for the "week" enum as well ?
My python script for context (with cfg being each file configuration obtained after parsing) :
for scope in cfg.scopes:
print(' Id:' + scope.Id)
if scope.className:
print(' name:' + scope.className)
if scope.type:
print(' type:' + scope.type)
The python script doesn't really matter here since the scopes are not even in the .dump xml result file.
And our call to cppcheck (in a .bat file):
cppcheck.exe --enable=all -j 4 --xml --dump <target_file>