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
<ntfs-3g/layout.h> 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.
pull/7/head
Eric Biggers 2020-08-24 21:36:33 -07:00
parent 3a474d45f4
commit f27f924c1e
1 changed files with 3 additions and 3 deletions

View File

@ -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 {