Have restore at end reset the internal counter of -esym
Right now, this works correctly only for -e#, but very often, programmers make mistakes using -esym as well.
Would be nice to not have to debug those using -voif.
Example:
@module foo.cpp
namespace test
{
extern bool bar(void);
extern bool flag;
bool foo(void)
{
//the next line is a programmer mistake which is carried on into bar.cpp despite using -restoreatend
//lint -esym(1960,5-14-1)
return flag && bar();
}
}
@module bar.cpp
namespace test
{
extern bool foo(void);
extern bool flag;
bool bar(void)
{
// Violates 5-14-1 but is not reported due to error in previous module
return flag && foo();
}
}
Run PC-LINT using lint-nt.exe au-misra-cpp.lnt -restoreatend foo.cpp bar.cpp
Options encountered within source files no longer affect subsequent source files in the upcoming PC-lint Plus which resolves this issue.