Skip to content

RULE-5-4: Ignore macros defined on different compilation paths #768

Closed
@lcartey

Description

@lcartey

Affected rules

  • RULE-5-4

Description

Macros defined on different compilation paths do not fall afoul of this rule - the first macro must be defined in the same compilation to trigger the rule. We should consider:

  • Conditional includes
  • Conditional macro assignment e.g. macros defined in different branches of a #ifdef/#elsif.
  • Macros defined inside an #ifndef <MACRO_NAME> check for the same name.

Example

#ifdef FOO
#define X 1 // COMPLIANT
#else
#define X 2 // COMPLIANT
#endif

Metadata

Metadata

Assignees

Labels

Difficulty-MediumA false positive or false negative report which is expected to take 1-5 days 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