Skip to content

RULE-8-13: Different compilations of the same variable #761

Closed
@lcartey

Description

@lcartey

Affected rules

  • RULE-8-13

Description

In cases where a piece of code is compiled multiple times in different contexts, a variable declaration may be written to in some contexts, but not others. In CodeQL, we store different copies of the Variable for the different contexts (so that they can be distinguished in our analysis). However, flagging one copy of a variable as missing const, when other copies cannot be marked as const, seems unreasonable.

Example

int test(int* x) { // COMPLIANT - written to in at least one context
#ifdef FOO
  x = 1;
#endif
  return x;
}

Metadata

Metadata

Assignees

Labels

Difficulty-MediumA false positive or false negative report which is expected to take 1-5 days effort to addressImpact-Mediumfalse positive/false negativeAn issue related to observed false positives or false negatives.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions