[previous] MISRA C:2012  Rule-5.1:  (Required) [next] External identifiers shall be distinct

Amplification:

This rule requires that different external identifiers be distinct within the limits imposed by the implementation.

The definition of distinct depends on the implementation and on the version of the C language that is being used:

In practice, many implementations provide greater limits. For example it is common for external identifiers in C90 to be case-sensitive and for at least the first 31 characters to be significant.

Example Code:


#pragma PRQA_MESSAGES_OFF 3408

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

     /* 1234567890123456789012345678901********* Characters */
int32_t engine_exhaust_gas_temperature_raw;
int32_t engine_exhaust_gas_temperature_scaled;                  /* 0777 */      /* Non-compliant */

     /* 1234567890123456789012345678901********* Characters */
int32_t engine_exhaust_gas_temp_raw;
int32_t engine_exhaust_gas_temp_scaled;                         /*      */      /* Compliant */


QAC messages that encompass this guideline:

0777 [U] External identifier does not differ from other identifier(s) (e.g. '%s') within the specified number of significant characters.


Related rules:

Rule-1.3 There shall be no occurrence of undefined or critical unspecified behaviour



(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