[U-Boot] [BUG] net: nfs: -Werror=address-of-packed-member
Heinrich Schuchardt
xypron.glpk at gmx.de
Mon Sep 2 21:38:46 UTC 2019
Hello Joe,
GCC 9.2.1 (of Debian Bullseye) produces the warnings below when building
pine64-lts_defconfig. Is it really necessary to define struct rpc_t as
packed? The structure is composed out of uint32_t only. So shouldn't it
be naturally packed without the attribute?
net/nfs.c: In function ‘rpc_req’:
net/nfs.c:199:18: error: taking address of packed member of ‘struct
rpc_t’ may result in an unaligned pointer value
[-Werror=address-of-packed-member]
199 | p = (uint32_t *)&(rpc_pkt.u.call.data);
| ^~~~~~~~~~~~~~~~~~~~~~
net/nfs.c: In function ‘nfs_readlink_reply’:
net/nfs.c:631:46: error: taking address of packed member of ‘struct
rpc_t’ may result in an unaligned pointer value
[-Werror=address-of-packed-member]
631 | nfs3_get_attributes_offset(rpc_pkt.u.reply.data);
| ~~~~~~~~~~~~~~~^~~~~
LD drivers/block/built-in.o
net/nfs.c: In function ‘nfs_read_reply’:
net/nfs.c:692:46: error: taking address of packed member of ‘struct
rpc_t’ may result in an unaligned pointer value
[-Werror=address-of-packed-member]
692 | nfs3_get_attributes_offset(rpc_pkt.u.reply.data);
| ~~~~~~~~~~~~~~~^~~~~
Best regards
Heinrich
More information about the U-Boot
mailing list