...
This compliant solution also complies with EXP34-C. Do not dereference null pointers in the implementation of f()
. With this definition, the output becomes:
...
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
---|---|---|---|---|---|
OOP33OOP51-CPP | Low | Probable | Medium | P4 | L3 |
...
CERT C++ Coding Standard | CTR56-CPP. Do not use pointer arithmetic on polymorphic objects |
CERT C Coding Standard |
Bibliography
[ISO/IEC 14882-2014] | 12.8, "Copying and Moving Class Objects" |
[Dewhurst 02] | Gotcha #38, "Slicing" |
[Sutter 00] | GotW #22: "Object Lifetimes - Part I" |
...