![]() |
![]() |
1022 | ![]() |
||||
![]() | |||||||
| Language extensions | |||||||
The '__alignof__' operator has been used. Message 1022 identifies instances of this language extension. __alignof__ can be used in much the same way as 'sizeof'. Instead of returning a size, it returns a value which represents the alignment requirement of the operand (in bytes). As with 'sizeof', the operand may be either an expression or an explicit type. In the context of QAC, __alignof__ will return the alignment value as determined from the configuration option -align. For example:
/*PRQA S 1257,2017,3198,3199,3203,3408 ++*/
extern void foo(void)
{
int test;
test = __alignof__(char); /* Message 1022 */
test = __alignof__(test); /* Message 1022 */
}
MISRA C:2012 Rules applicable to message 1022:
| 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 |