From f27f924c1ee90d56f9773aaba0aaab96b93dd306 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Mon, 24 Aug 2020 21:36:33 -0700 Subject: [PATCH] Avoid -Waddress-of-packed-member warning Add __attribute__((packed)) to the on-disk reparse point structures to avoid a compiler warning about a potential unaligned pointer when casting a pointer to REPARSE_POINT (which is defined in using __attribute__((packed))) to a pointer to WOF_FILE_PROVIDER_REPARSE_POINT_V1. This warning is probably a false positive since the REPARSE_POINT from NTFS-3G should be aligned in practice. But we shouldn't assume that. --- src/system_compression.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/system_compression.c b/src/system_compression.c index 0107126..d9ba82b 100644 --- a/src/system_compression.c +++ b/src/system_compression.c @@ -92,14 +92,14 @@ typedef enum { typedef struct { le32 version; le32 provider; -} WOF_EXTERNAL_INFO; +} __attribute__((packed)) WOF_EXTERNAL_INFO; /* Metadata for the compressed file provider --- indicates how the file * is compressed */ typedef struct { le32 version; le32 compression_format; -} WOF_FILE_PROVIDER_EXTERNAL_INFO_V1; +} __attribute__((packed)) WOF_FILE_PROVIDER_EXTERNAL_INFO_V1; /* Format of the reparse point attribute of system compressed files */ typedef struct { @@ -114,7 +114,7 @@ typedef struct { /* The metadata specific to the compressed file "provider" */ WOF_FILE_PROVIDER_EXTERNAL_INFO_V1 file; -} WOF_FILE_PROVIDER_REPARSE_POINT_V1; +} __attribute__((packed)) WOF_FILE_PROVIDER_REPARSE_POINT_V1; /* The available compression formats for system compressed files */ typedef enum {