Hello,
On Sat, Apr 04, 2020 at 09:27:34AM +0100, Kevin Darbyshire-Bryant wrote:
> dns.c:261:2: error: converting a packed ‘struct dns_question’ pointer
> (alignment 1) to a ‘uint16_t’ {aka ‘short unsigned int’} pointer
> (alignment 2) may result in an unaligned pointer value
> [-Werror=address-of-packed-member]
>
> 261 | uint16_t *swap = (uint16_t *) q;
>
> Work around what I think is a false positive by turning the warning off.
It seems that packed structures have no alignment guarantees at all
(beyond the size they're packed for), so even the first member can't
be used like that. So the warning looks legit?
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:[email protected]
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel