codeql-coding-standards
codeql-coding-standards copied to clipboard
`RULE-11-3`: Permit cast to pointer-to-void
Affected rules
-
RULE-11-3
Description
The rule states that "a cast shall not be performed between a pointer to object type and a pointer to a different object type". However, void isn't a different object type. Rule 11.5 handles pointer-to-void, prohibiting casting from pointer-to-void, but permitting casting to pointer-to-void.
Example
uint32_t *p32;
void *p;
p = p32; // Compliant