![]() |
![]() |
0547 | ![]() |
||||
![]() | |||||||
| Constraint violations | REFERENCE - ISO:C90-6.5 Declarations - Constraints, ISO:C90-6.5.2.3 Tags | ||||||
This is a constraint error This tag has already been declared within the same scope. The same tag cannot be used to declare a struct as well as a union (or an enum) because there is only a single name space for all tags. Nor is it permitted to declare the same tag more than once even when the declarations are identical. For example:
/*PRQA S 553,750,2017,3132,3602,3625 ++*/
struct RECORD1
{
unsigned int number;
};
union RECORD1 /* Message 0547 */
{
unsigned int number;
unsigned char n[4];
};
struct RECORD2
{
int size;
signed char sca[20];
};
struct RECORD2 /* Message 0547 */
{
int size;
signed char sca[20];
}; /* Message 0653 */
struct RECORD3
{
int n;
char buf[20];
};
struct RECORD3 /* Message 0547 */
{
int n;
int buf[21];
}; /* Message 0653 */
MISRA-C:2004 Rules applicable to message 0547:
| Rule 1.1 (Required) | 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 |
| Rule 5.4 (Required) | A tag name shall be a unique identifier. |
See also:
![]() | ||
| QA·C Source Code Analyser 8.1
MISRA-C:2004 Compliance Module 3.2 © 2012 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index | Contents |