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

RULE-21-15: Improve detection of compatible types #573

Open
Labels
Difficulty-MediumA false positive or false negative report which is expected to take 1-5 days effort to address Impact-Medium Standard-MISRA-C false positive/false negativeAn issue related to observed false positives or false negatives.
@lcartey

Description

Affected rules

  • RULE-21-15

Description

The query for this rule is currently too strict - it requires the types be identical (after stripping specifiers), instead of compatible. For example, it does not allow a combination of pointers and arrays, or array types with different sizes, or types which are compatible but not identical (e.g. signed int and int.

Example

void example_function(int i1[80], int *i2, int i3[10], signed int *i4) {
 memcpy(i1,i2,1); // COMPLIANT[FALSE_POSITIVE]
 memcpy(i1,i3,1); // COMPLIANT[FALSE_POSITIVE]
 memcpy(i2,i3,1); // COMPLIANT[FALSE_POSITIVE]
 memcpy(i2,i4,1); // COMPLIANT[FALSE_POSITIVE]
}

Metadata

Metadata

Labels

Difficulty-MediumA false positive or false negative report which is expected to take 1-5 days effort to address Impact-Medium Standard-MISRA-C 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 によって変換されたページ (->オリジナル) /