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
![](https://secure.gravatar.com/avatar/8c0cb4875ae96d848d05d69963697966?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
Options encountered within source files no longer affect subsequent source files in the upcoming PC-lint Plus which resolves this issue.