Skip to content

A7-1-3: Triggered on static_cast #601

Closed
@nbusser

Description

@nbusser

Affected rules

  • A7-1-3

Description

For some reason, A7-1-3 is triggered on basic varibales created from static_cast

Example

void false_positive() {
    std::uint8_t u8{0};

    auto const u32 = static_cast<std::uint32_t>(u8); // Triggers A7-1-3 warning
    std::uint32_t const u32b = static_cast<std::uint32_t>(u8); // Triggers A7-1-3 warning

    const auto u32c = static_cast<std::uint32_t>(u8); // Triggers A7-1-3 warning
    const std::uint32_t u32d = static_cast<std::uint32_t>(u8); // Triggers A7-1-3 warning
}

Metadata

Metadata

Assignees

Labels

Difficulty-MediumA false positive or false negative report which is expected to take 1-5 days 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

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions