Received: from list by lists.gnu.org with archive (Exim 4.71) id 1hVsH1-0000Pq-Vv for mharc-grub-devel@gnu.org; Wed, 29 May 2019 02:41:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVsH0-0000Og-42 for grub-devel@gnu.org; Wed, 29 May 2019 02:41:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVsGy-0007qQ-W7 for grub-devel@gnu.org; Wed, 29 May 2019 02:41:18 -0400 Received: from outpost18.zedat.fu-berlin.de ([130.133.4.111]:55619) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVsGy-00071S-Am for grub-devel@gnu.org; Wed, 29 May 2019 02:41:16 -0400 Received: from relay1.zedat.fu-berlin.de ([130.133.4.67]) by outpost.zedat.fu-berlin.de (Exim 4.85) with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (envelope-from ) id <1hVsGu-003IAv-Ot>; Wed, 29 May 2019 08:41:12 +0200 Received: from z6.physik.fu-berlin.de ([160.45.32.137] helo=z6) by relay1.zedat.fu-berlin.de (Exim 4.85) with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (envelope-from ) id <1hVsGu-001ERz-MV>; Wed, 29 May 2019 08:41:12 +0200 Received: from glaubitz by z6 with local (Exim 4.92) (envelope-from ) id 1hVsBV-0008MS-Td; Wed, 29 May 2019 08:35:37 +0200 From: John Paul Adrian Glaubitz To: grub-devel@gnu.org Cc: Daniel Kiper , Michael Chang , John Paul Adrian Glaubitz Subject: [PATCH] f2fs: Disable gcc9 -Waddress-of-packed-member Date: Wed, 29 May 2019 08:34:55 +0200 Message-Id: <20190529063454.32016-1-glaubitz@physik.fu-berlin.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Originating-IP: 160.45.32.137 X-ZEDAT-Hint: RV X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 130.133.4.111 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2019 06:41:19 -0000 Disable the -Wadress-of-packaed-member diagnostic for the grub_f2fs_label function since the result is found to be false postive. A pointer to the 'volume_name' member of 'struct grub_f2fs_superblock' is guaranteed to be aligned as the offset of 'volume_name' within the struct is dividable by the natural alignment on both 32- and 64-bit targets. grub-core/fs/f2fs.c: In function ‘grub_f2fs_label’: grub-core/fs/f2fs.c:1253:60: error: taking address of packed member of ‘struct grub_f2fs_superblock’ may result in an unaligned pointer value [-Werror=address-of-packed-member] 1253 | *label = (char *) grub_f2fs_utf16_to_utf8 (data->sblock.volume_name); | ~~~~~~~~~~~~^~~~~~~~~~~~ cc1: all warnings being treated as errors Signed-off-by: John Paul Adrian Glaubitz --- grub-core/fs/f2fs.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/grub-core/fs/f2fs.c b/grub-core/fs/f2fs.c index bb28b291b..8a9992ca9 100644 --- a/grub-core/fs/f2fs.c +++ b/grub-core/fs/f2fs.c @@ -1240,6 +1240,11 @@ grub_f2fs_utf16_to_utf8 (grub_uint16_t *in_buf_le) return out_buf; } +#if __GNUC__ >= 9 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Waddress-of-packed-member" +#endif + static grub_err_t grub_f2fs_label (grub_device_t device, char **label) { @@ -1260,6 +1265,10 @@ grub_f2fs_label (grub_device_t device, char **label) return grub_errno; } +#if __GNUC__ >= 9 +#pragma GCC diagnostic pop +#endif + static grub_err_t grub_f2fs_uuid (grub_device_t device, char **uuid) { -- 2.20.1