Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
Closed
@lcartey

Description

@lcartey
Issue body actions

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 addressA 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.An issue related to observed false positives or false negatives.

Type

No type

Projects

Status

Done
Show more project fields

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.