[U-Boot] [PATCH 1/1] net: unaligned copying of unsigned long
Joe Hershberger
joe.hershberger at ni.com
Mon Jul 15 18:09:28 UTC 2019
On Sun, Jul 14, 2019 at 3:02 PM Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>
> The inline functions net_read_u32() and net_copy_u32() have been created to
> copy unaligned u32. But this is not obvious to the compiler. GCC 9.1
> introduces a check -Werror=address-of-packed-member which leads to a build
> error on Travis CI:
>
> net/bootp.c: In function ‘dhcp_send_request_packet’:
> net/bootp.c:1011:27: error: taking address of packed member of
> ‘struct bootp_hdr’ may result in an unaligned pointer value
> [-Werror=address-of-packed-member]
> 1011 | net_copy_u32(&bp->bp_id, &bp_offer->bp_id);
>
> Change the type of the function parameters to void * to avoid the build
> error.
>
> Reported-by: Ramon Fried <rfried.dev at gmail.com>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
Acked-by: Joe Hershberger <joe.hershberger at ni.com>
More information about the U-Boot
mailing list