[previous] MISRA C:2012  Dir-4.5:  (Advisory) [next] Identifiers in the same name space with overlapping visibility should be typographically unambiguous

Amplification:

The definition of the term "unambiguous" should be determined for a project taking into account the alphabet and language in which the source code is being written.

For the Latin alphabet as used in English words, it is advised as a minimum that identifiers should not differ by any combination of:

Example Code:


#include "misra.h"
#include "m3cmex.h"

extern int16_t dir_0405( void )
{
    int32_t id1_a_b_c;
    int32_t id1_abc;                            /* Non-compliant */
    int32_t id2_abc;
    int32_t id2_ABC;                            /* Non-compliant */
    int32_t id3_a_bc;
    int32_t id3_ab_c;                           /* Non-compliant */
    int32_t id4_I;
    int32_t id4_1;                              /* Non-compliant */
    int32_t id5_Z;
    int32_t id5_2;                              /* Non-compliant */
    int32_t id6_O;
    int32_t id6_0;                              /* Non-compliant */
    int32_t id7_B;
    int32_t id7_8;                              /* Non-compliant */
    int32_t id8_rn;
    int32_t id8_m;                              /* Non-compliant */
    int32_t id9_rn;
    struct ST {
        int32_t id9_m;                          /* Compliant */
    };

    return 1;
}


No QAC messages cover this rule.



(c) The Motor Industry Research Association, 2012
QA C Source Code Analyser 8.1.2
MISRA C:2012 Compliance Module 1.0
© 2013 Programming Research
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index Contents