github / codeql-coding-standards

This repository contains CodeQL queries and libraries which support various Coding Standards.
MIT License
129 stars 59 forks source link

`RULE-10-4`: Incorrect essential types identified #747

Closed lcartey closed 1 month ago

lcartey commented 1 month ago

Affected rules

Description

This rule has a number of issues related to how essential types are resolved:

Example

void example_function(char c, int i) {
  typedef enum { A } EA;
  EA ea = A;
  ea == A; // COMPLIANT[FALSE_POSITIVE]
  c == `\n`; // COMPLIANT[FALSE_POSITIVE]
  enum { B };
  i == B; // COMPLIANT[FALSE_POSITIVE]
}