HomeClusterLabs Projects

totemsrp: Fix warnings produced by gcc 9.1

Description

totemsrp: Fix warnings produced by gcc 9.1

New gcc warn about passing posibly unaligned pointer from packed
structure. This shouldn't be problem for x86.

Implemented solution is to let compiler do its job (compiler knows if
pointer is aligned so accessing structure field is safe) and
use it together with support for asigning and returning of structure
(not a pointer to the structure).

  • srp_addr_copy is removed and replaced by simple assignment
  • srp_addr_copy_endian_convert is removed and replaced by srp_addr_endian_convert function which takes srp_addr structure and returns endian converted srp_addr structure
  • functions which accepts srp_addr array are not changed because (luckily) non-aligned pointer is always just one item array and such item is always used as a source pointer so it's possible to use temporary variable

Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>

Details

Provenance
jfriesseAuthored on Jun 4 2019, 9:24 AM
Parents
rC3c7f19a02fbf: cpg: Move filling of member_list to subfunction
Branches
Unknown
Tags
Unknown

Event Timeline