I am using PC Lint and have faced this problem. I have a code something like below:
class A {
public:
virtual void doSth(int* arg);
}
class B : A {
public:
void doSth(int* arg) {...}
}
One of my methods has a pointer parameter. This of course makes PC Lint angry about possible NULL pointer parameter (error 613, which is ok by design, I am not arguing with that). However I know that in my program I never pass a NULL pointer. On the other hand I don't want to disable 613 warnings in the entire method completely so I dropped an idea of using
//lint -efunc(613,*::doSth)
I decided to stick with the -esym(613, arg), +esym(613, arg) wrapping my methods.
What I am considering is is there maybe a more generic approach to this problem using the base class? How to suppress warnings for *arg in virtual doSth() method so it will include all methods from derived classes? Is it possible with PC Lint?