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

Sign up
Appearance settings

A4-7-1: integer data loss false positive erasing from container #793

Open
Labels
Difficulty-HighA false positive or false negative report which is expected to take 1+ week effort to address Impact-Medium Standard-AUTOSAR false positive/false negativeAn issue related to observed false positives or false negatives.
@fjatWbyT

Description

Affected rules

  • A4-7-1

Description

Decrement cannot lead to wrap-around since the container is checked for emptiness.

Example

class container
{
 bool empty()
 {
 return num_items_ == 0;
 }
 void erase()
 {
 if (empty())
 return;
 num_items_--;
 }
 std::size_t num_items_ = 0;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty-HighA false positive or false negative report which is expected to take 1+ week effort to address Impact-Medium Standard-AUTOSAR false positive/false negativeAn issue related to observed false positives or false negatives.

    Type

    No type

    Projects

    Status

    Triaged

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /