From 845e5ef706cb7e29259d6541f43a7029e7dc7898 Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Fri, 13 Mar 2020 10:22:07 -0400 Subject: [PATCH] xfsprogs: don't warn about packed members MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- include/builddefs.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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@ -- 2.50.1