Rule 5.8: identifiers of interest

Moderators: misra-c, david ward

Post Reply
Posts: 4
Joined: Thu Mar 20, 2014 2:50 pm
Company: Klocwork

Rule 5.8: identifiers of interest

Post by sca2012 » Tue Sep 03, 2019 9:24 pm

The main goal of rule 5.8 (as well as 5.9), judging from the examples and amplifications, is to ensure that identifiers referring to objects or functions are not confused with the same identifiers that refer to different objects or functions.

How about identifiers that are reused by do not refer to neither objects nor functions?

For instance, a struct member:

Code: Select all

int i;

struct S {
    int i;    // identifier is reused but cannot actually be confused with the object i at line 1
Is this scenario still a violation to the rule?

Post Reply

Return to “8.5 Identifers”