umdns: suppress address-of-packed-member warning
authorKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Sat, 4 Apr 2020 08:20:08 +0000 (09:20 +0100)
committerRISCi_ATOM <Bob@bobcall.me>
Wed, 22 Apr 2020 00:52:33 +0000 (20:52 -0400)
gcc 8 & 9 appear to be more picky with regards access alignment to
packed structures, leading to this warning in dns.c:

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.
Not ideal, but not quite as not ideal as build failure.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit 02640f014719a994e2e538b2cb6376a189cd39de)
(cherry picked from commit a10b6ec1c8cd6d14a3b76a2ec3d81442b85f7321)

package/network/services/umdns/Makefile

index 845141bb3a53da47cde8a8aa319d0c89e37ceef3..16bb934f3e100ee099bfdf4e4e32a6916f1ef30e 100644 (file)
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=umdns
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_URL=$(PROJECT_GIT)/mdnsd.git
 PKG_SOURCE_PROTO:=git
@@ -30,7 +30,7 @@ define Package/umdns
   DEPENDS:=+libubox +libubus +libblobmsg-json
 endef
 
-TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
+TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include -Wno-address-of-packed-member
 
 define Package/umdns/conffiles
 /etc/config/umdns