Skip to contentSkip to conversation

tools: hv: suppress the invalid warning for packed member alignment

PATCH Superseded Saurabh Sengar 2 participants 4 messages Apr 17, 2024 – May 4, 2024

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: hv: suppress the invalid warning for packed member alignment

Packed struct vmbus_bufring is 4096 byte aligned and the reporting warning is for the first member of that struct which shouldn't add any offset to create alignment issue.

Suppress the warning by adding -Wno-address-of-packed-member flag to gcc.

---
 tools/hv/Makefile | 1 +
 1 file changed, 1 insertion(+)
tools/hv/Makefile +1 -0
index bb52871da341..2e60e2c212cd 100644
@@ -17,6 +17,7 @@ endif
 MAKEFLAGS += -r
 
 override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include
+override CFLAGS += -Wno-address-of-packed-member
 
 ALL_TARGETS := hv_kvp_daemon hv_vss_daemon
 ifneq ($(ARCH), aarch64)
Signature · 1 line
2.34.1
#1 lore raw
Quoted 10 lines · Saurabh Sengar

Packed struct vmbus_bufring is 4096 byte aligned and the reporting warning is for the first member of that struct which shouldn't add any offset to create alignment issue.

Suppress the warning by adding -Wno-address-of-packed-member flag to gcc.

What commit id does this fix?

thanks,

greg k-h

#2 lore raw
Quoted 5 lines · Greg KH
Quoted 4 lines · Saurabh Sengar

Packed struct vmbus_bufring is 4096 byte aligned and the reporting warning is for the first member of that struct which shouldn't add any offset to create alignment issue.

Quoted 8 lines
Quoted 6 lines

Suppress the warning by adding -Wno-address-of-packed-member flag to gcc.

What commit id does this fix?

Fixes 45bab4d74651 ("tools: hv: Add vmbus_bufring")

- Saurabh

#3 lore raw
Quoted 9 lines · Saurabh Singh Sengar
Quoted 8 lines · Greg KH
Quoted 7 lines · Saurabh Sengar

Packed struct vmbus_bufring is 4096 byte aligned and the reporting warning is for the first member of that struct which shouldn't add any offset to create alignment issue.

Suppress the warning by adding -Wno-address-of-packed-member flag to gcc.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

What commit id does this fix?

Fixes 45bab4d74651 ("tools: hv: Add vmbus_bufring")

Great, please provide that in the next verion of this change you send out.

thanks,

greg k-h