Skip to content

Fix gcc9 "taking address of packed member may result in an unaligned pointer value" warning

Gerhard Raven requested to merge fix-unaligned-pointer-warning into master

Fix the following gcc9 warning:

DAQ/MDF/MDF/MDFHeader.h:83:56: warning: taking address of packed member of 'LHCb::MDFHeader::HeaderTriggerMask' may result in an unaligned pointer value [-Waddress-of-packed-member]	
   83 |       const unsigned int* triggerMask() const { return m_trMask; }

by not forming pointers to a packed member, but instead return them by value (which results in 16 bytes getting copied, instead of an 8 byte pointer being formed)

Edited by Marco Cattaneo

Merge request reports

Loading