codeql-coding-standards icon indicating copy to clipboard operation
codeql-coding-standards copied to clipboard

`RULE-8-13`: Consider possible macro false positives

Open lcartey opened this issue 1 year ago • 0 comments

Affected rules

  • RULE-8-13

Description

Should we flag variables generated from macro expansions as missing const?

Some considerations:

  • Should we flag the macro itself, as that's where const would need to be added?
  • If so, should we only flag if the variable could be const in all instantiations of the macro?

Example

#define FOO int x = 0;

..
int f() {
  FOO; // NON_COMPLIANT?
  return x;
}

lcartey avatar Oct 22 '24 21:10 lcartey