Skip to content

A8-5-2: Reports a violation even for correctly initialized variables as per the rule #645

Open
@rak3-sh

Description

@rak3-sh

Affected rules

  • A8-5-2

Description

This rule reports violation for the following code (which is correct as per the rule).

Example

void example_function() {
  const int32_t a {array[i]};
  int32_t ret {0};
  myclass01 bbb {6};
}

The reason seems to be the limitation mentioned in the query that CodeQL doesn't store this syntactic information about the form of initialization in the database. The heuristic implemented in the query to check for the violation doesn't work for the above code snippet because of the presence of a whitespace between the variable name and the initialization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty-LowA false positive or false negative report which is expected to take <1 day effort to addressImpact-MediumStandard-AUTOSARfalse positive/false negativeAn issue related to observed false positives or false negatives.user-reportIssue reported by an end user of CodeQL Coding Standards

    Type

    No type

    Projects

    Status

    Triaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions