From: Dave Chinner Date: Fri, 13 Mar 2020 14:22:07 +0000 (-0400) Subject: xfsprogs: don't warn about packed members X-Git-Tag: v5.5.0~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=845e5ef706cb7e29259d6541f43a7029e7dc7898;p=users%2Fhch%2Fxfsprogs.git xfsprogs: don't warn about packed members gcc 9.2.1 throws lots of new warnings during the build like this: xfs_format.h:790:3: warning: taking address of packed member of ‘struct xfs_agfl’ may result in an unaligned pointer value [-Waddress-of-packed-member] 790 | &(XFS_BUF_TO_AGFL(bp)->agfl_bno[0]) : \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ xfs_alloc.c:3149:13: note: in expansion of macro ‘XFS_BUF_TO_AGFL_BNO’ 3149 | agfl_bno = XFS_BUF_TO_AGFL_BNO(mp, agflbp); | ^~~~~~~~~~~~~~~~~~~ We know this packed structure aligned correctly, so turn off this warning to shut gcc up. Signed-off-by: Dave Chinner Reviewed-by: Eric Sandeen [sandeen: kernel has done this globally as well in 6f303d60534] Signed-off-by: Eric Sandeen --- diff --git a/include/builddefs.in b/include/builddefs.in index 2987f0b89..891bf93d7 100644 --- a/include/builddefs.in +++ b/include/builddefs.in @@ -13,7 +13,7 @@ OPTIMIZER = @opt_build@ MALLOCLIB = @malloc_lib@ LOADERFLAGS = @LDFLAGS@ LTLDFLAGS = @LDFLAGS@ -CFLAGS = @CFLAGS@ -D_FILE_OFFSET_BITS=64 +CFLAGS = @CFLAGS@ -D_FILE_OFFSET_BITS=64 -Wno-address-of-packed-member BUILD_CFLAGS = @BUILD_CFLAGS@ -D_FILE_OFFSET_BITS=64 LIBRT = @librt@