Skip to content

M5-2-10: Only report increment/decrement mixing with arithmetic operators #361

Closed
@lcartey

Description

@lcartey

Affected rules

  • M5-2-10

Description

The title for this rule states "The increment (++) and decrement (--) operators should not be mixed with other operators in an expression.". However, the rationale makes clear that this is only intended to cover arithmetic operators:

The use of increment and decrement operators in combination with other arithmetic operators is
not recommended

Example

This will help reduce false positives on idiomatic code such as *i++.

*iter++;

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.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