/* >>>------------------------------------------------------------ * * File: rule_20.6.c, Module: M2CM-3.2-QAC-8.1.2 * * RULE 20.6 (Required): * The macro offsetof, in library , shall not be used. * * Implemented by message: * 5120 The macro offsetof, in library , shall not be * used. * * <<<------------------------------------------------------------ */ /* PRQA S 2983,3203 ++ */ #include #include "misra.h" #include "m2cmex.h" extern S16 test_2006( void ) { struct stag { S32 a; F64 b; } s; size_t p; s.a = 1; s.b = 0.0; p = offsetof( struct stag, b ); /* MISRA Violation */ return 0; }