shared ptr NULL check

PC-lint Plus User Discussion
Post Reply

shared ptr NULL check

Post by Bob »

We use PC-lint Plus 1.3.5 on X86_64 Linux system, does PC-lint support shared pointer NULL check?
For example:

Code: Select all

#include <memory>
#include <iostream>
struct A{
    int a{0};

int main(int argc, const char *argv[]) {
    std::unique_ptr<A> p;
    std::cout << p->a << std::endl;

    std::cout << p.get()->a << std::endl;

    return 0;

For above code, when compile and run, it surely will abort, can PC-lint support NULL pointer check?

Re: shared ptr NULL check

Post by mmetivier »

The online demo at would seem to indicate "no".
Post Reply