Why do I receive warnings about incorrect this-pointer type in PolySpace Client for C/C++ 4.2 (R2007a+)?

2 views (last 30 days)
Within the verification results I often see the following warnings:
Warning : call to virtual function GetMotionClassification may be pure
Warning : this-pointer type of GetMotionClassification may be incorrect
this-pointer is not null
This warning is clear to me (a virtual method is not defined), but from my point of view every method is defined in its related class.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This is expected behavior.
These messages only occur on member methods associated with polymorphic classes.
Every time you call a member method, PolySpace tries to resolve in a scheduled and chronological order:
1. If the Instance is null or not?
Implies a check NNT: ‘non null this-pointer’ type
2. Is it a virtual method?
Implies a check [CTT]: ‘incorrect this-pointer type’
3. Does it concern a pointer on a virtual method?
Implies a check [VFC]: ‘Call a virtual Pure Method’
4. Some Informative checks give potential calls:
i.e. some eligible methods associated to the this-pointer.
5. At the end, PolySpace verifies if the function can also throw an exception or not.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!