#This script is designed to run with Understand - CodeCheck #Robert Gempeler - 7/19/2010 use base ("Understand::Codecheck"); use strict; use constant ERR1 => 'Invalid use of "offsetof" macro.'; sub register_tr_text() { my $check = shift; $check->add_tr_text(ERR1); } sub name { return "18-2-1 The macro \"offsetof\" shall not be used.";} sub description { return "18-2-1 (Required) The macro \"offsetof\" shall not be used.";} sub detailed_description { return <<"END_DESC"
Rationale
Use of the offsetof macro can lead to undefned behaviour when the types of the operands are incompatible
or when bit felds are used.