kpartx: dasd: fix -Waddress-of-packed-member warning from gcc9
authorMartin Wilck <mwilck@suse.com>
Mon, 24 Jun 2019 09:27:26 +0000 (11:27 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Wed, 3 Jul 2019 06:30:27 +0000 (08:30 +0200)
commit3bb52dc2eb05e2eab7e190490ac61ed1aedd4240
treef421ff57d62b3e3063ce51f7a36e21e3ef8b8f23
parent65e18453ba245700ea1fa8a015a048407b519029
kpartx: dasd: fix -Waddress-of-packed-member warning from gcc9

Fixes the following warning:

dasd.c: In function ‘read_dasd_pt’:
dasd.c:206:3: warning: converting a packed ‘volume_label_t’ {aka ‘struct
volume_label’} pointer (alignment 1) to a ‘label_ints_t’ {aka ‘unsigned int’}
pointer (alignment 4) may result in an unaligned pointer value
[-Waddress-of-packed-member]
  206 |   label_ints_t *label = (label_ints_t *) &vlabel;
      |   ^~~~~~~~~~~~

As volume_label_t is only used in read_dasd_pt(), and filled with memcpy(),
increasing its alignment should be safe.

Signed-off-by: Martin Wilck <mwilck@suse.com>
kpartx/dasd.h