Skip to content

RULE-8-13: Consider assignment to struct fields as writing to pointer to object #762

Closed
@lcartey

Description

@lcartey

Affected rules

  • RULE-8-13

Description

Writing to a struct field should be considered writing to the object itself.

Example

struct S {
  int* x;
};

void example_function(struct S s) { // COMPLIANT - can't be const, written to in struct call
  s->x = 1;
}

Metadata

Metadata

Assignees

Labels

Difficulty-LowA false positive or false negative report which is expected to take <1 day effort to addressImpact-Highfalse positive/false negativeAn issue related to observed false positives or false negatives.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions