A cast shall not remove any const or volatile qualification from the type pointed to by a pointer
A cast shall not remove any const or volatile qualification from the type pointed to by a pointer.
This rule forbids:
Casts from a pointer to a const object
to a pointer that does not point to a const object.
Casts from a pointer to a volatile object
to a pointer that does not point to a volatile object.
Such casts violate type qualification. For example, the const qualifier
indicates the read-only status of an object. If a cast removes the
qualifier, the object is no longer read-only.
Polyspace® flags both implicit and explicit conversions that violate this rule.
If you expect a rule violation but do not see it, refer to the documentation of Polyspace Code Prover™ or Polyspace Code Prover Server™.
| Group: Pointer Type Conversions |
| Category: Required |
| AGC Category: Required |