![]() |
![]() |
0662 | ![]() |
||||
![]() | |||||||
| Language extensions | |||||||
A nested structure member is being accessed in a non-standard way. In the example below, 'a' and 'b' are defined as members of a nested unnamed structure. This language extension allows these elements to be accessed directly, just as if they were members of the parent structure.
/*PRQA S 1314,2017,3408,3447 ++*/
struct AT
{
int n;
struct SID
{
int a;
int b;
}; /* Message 0660 */
};
extern struct AT atx;
extern void foo(void)
{
atx.n = 1;
atx.a = 1; /* Message 0662 */
}
MISRA C:2012 Rules applicable to message 0662:
| 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 |