github/codeql-coding-standards

`RULE-8-4`: Improve detection of compatible types

lcartey opened this issue · 0 comments

Affected rules

  • DCL40-C
  • RULE-8-3
  • RULE-8-4

Description

There are some cases of compatible types which are not currently detected by these queries:

  • Enumerations - these are compatible with a specified integer type.
  • Array types - are compatible if the element types are compatible (and the sizes match, where appropriate)
  • Pointer types - are compatible in the pointer target types are compatible.
  • Function types - if the return/argument types are compatible (with some exceptions for functions that don't declare arguments).

Example