I suggest you ...

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 -restore_at_end
//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 -restore_at_end foo.cpp bar.cpp

1 vote
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Anonymous shared this idea  ·   ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base