Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M0-1-4: Recognise aggregate literal initializers #388

Closed
lcartey opened this issue Oct 4, 2023 · 0 comments · Fixed by #534
Closed

M0-1-4: Recognise aggregate literal initializers #388

lcartey opened this issue Oct 4, 2023 · 0 comments · Fixed by #534
Assignees
Labels
Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium user-report Issue reported by an end user of CodeQL Coding Standards

Comments

@lcartey
Copy link
Collaborator

lcartey commented Oct 4, 2023

Affected rules

  • M0-1-4

Description

M0-1-4 identifies single use variables, but for member variables we do not recognise the initialization of variables in an aggregate initializer as a use.

In addition, we should search for other places where we count uses of member variables to ensure this case is also captured there.

Example

struct agg {
  int x;
};

void test_agg() {
  agg a = {1};
  a.x;
}
@lcartey lcartey added Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium user-report Issue reported by an end user of CodeQL Coding Standards labels Oct 4, 2023
@rvermeulen rvermeulen self-assigned this Feb 8, 2024
This was referenced Feb 15, 2024
github-merge-queue bot pushed a commit that referenced this issue Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium user-report Issue reported by an end user of CodeQL Coding Standards
Projects
Development

Successfully merging a pull request may close this issue.

2 participants