![]() |
|
MISRA-C:2004 Rule 5.4: (Required) |
|
||||
![]() | |||||||
structstag{uint16_t a; uint16_t b;};structstag a1={0,0};/* Compliant - compatible with above */unionstag a2={0,0};/* Not compliant - not compatible with previous declarations */voidfoo(void){structstag{uint16_t a;};/* Not compliant - tag stag redefined */}
The same tag definition shall not be duplicated anywhere in the source code files even if the definitions are identical. Where the tag definition is made in a header file, and that header file is included in multiple source files, this rule is not violated.
QAC messages that encompass this guideline:
| 0547 | [C] This declaration of tag '%s' conflicts with a previous declaration. |
Related rules:
| Rule 1.1 | All code shall conform to ISO/IEC 9899:1990 C programming language, ISO 9899, amended and corrected by ISO/IEC 9899/COR1:1995, ISO/IEC 9899/AMD1:1995, and ISO/IEC 9899/COR2: 1996192 |
|
||
(c) The Motor Industry Research Association, 2004
|
QA C Source Code Analyser 8.1.2
MISRA-C:2004 Compliance Module 3.2 © 2013 Programming Research www.programmingresearch.com |
Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index | Contents |