Movatterモバイル変換


[0]ホーム

URL:


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

A7-5-2,RULE-8-2-10: callers of recursive functions reported as recursive #935

Open
Labels
Difficulty-LowA false positive or false negative report which is expected to take <1 day effort to addressImpact-LowStandard-AUTOSARStardard-MISRA-C++false positive/false negativeAn issue related to observed false positives or false negatives.false-positiveAn issue representing a false positive report.
@MichaelRFairhurst

Description

@MichaelRFairhurst

Affected rules

  • A7-5-2
  • RULE-8-2-10

Description

The query findsRecursiveCall rcs and then reportsFunctionCall fcs wherefc.getTarget() = rc.getTarget(). This means call sites of recursive functions are treated as recursive.

Recursion is something we should expect to be deviated. This bug imposes additional burden on developers to deviate at all callsites of functions that have been deemed safe recursion.

Discussion: is this bug a feature? Sometimes evaluating the safety of a recursive call depends on the entry point arguments. For instance, counting the length of a linked list is safe if the linked list has no cycles, which should be a check that precedes the recursive call.

Example

If we add these new lines to thetest.cpp file:

inttest_calls_recursive_function(int i) {test_recursive_function(i);// COMPLIANT}

We incorrectly get a result claiming thattest_calls_recursive_function is recursive. This is incorrect and unnecessary, sincetest_recursive_function is already flagged.

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-LowStandard-AUTOSARStardard-MISRA-C++false positive/false negativeAn issue related to observed false positives or false negatives.false-positiveAn issue representing a false positive report.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp