![]() |
![]() |
0633 | ![]() |
||||
![]() | |||||||
| Language extensions | REFERENCE - ISO:C90-6.5.2.1 Structure and Union Specifiers - Syntax | ||||||
A structure or union type is being defined with no members. This is an extension to the C language and is only supported by certain compilers. The size of an empty structure or union is assumed to be zero. Empty structures are an integral part of the C++ language, but the C++ Language Standard says they have size 1. A structure or union with no members is considered to be a complete type and should not be confused with declarations of incomplete type which are allowed in standard C. For example:
/*PRQA S 553,750,759,2017,2213,3210,3313,3447 ++*/
extern struct STA { } a; /* Message 0633 */
extern union UNB { } b; /* Message 0633 */
extern struct STC * pc; /* No message - pointer to incomplete struct */
extern union UND * pd; /* No message - pointer to incomplete union */
MISRA C:2012 Rules applicable to message 0633:
| Rule-1.2 (Advisory) | Language extensions should not be used |
See also:
![]() | ||
| QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0 © 2012 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index | Contents |