Do not set -Wpadded except for checking kmod-shared headers

Remove now-unneeded manual padding in arg structs.

Signed-off-by: Andy Grover <agrover@versity.com>
This commit is contained in:
Andy Grover
2020-12-10 13:57:16 -08:00
parent 5241bba7f6
commit d48b447e75
9 changed files with 9 additions and 8 deletions

View File

@@ -19,7 +19,6 @@ endif
SCOUTFS_FORMAT_HASH := $(shell cat $(HASH_FILES) | md5sum | cut -b1-16)
CFLAGS := -Wall -O2 -Werror -D_FILE_OFFSET_BITS=64 -g -msse4.2 \
-Wpadded \
-fno-strict-aliasing \
-DSCOUTFS_FORMAT_HASH=0x$(SCOUTFS_FORMAT_HASH)LLU

View File

@@ -13,7 +13,6 @@ static struct argp_command {
char *name;
struct argp *argp;
int group;
char __pad[4];
int (*func)(int argc, char **argv);
} argp_cmds[100], *next_argp_cmd = argp_cmds;

View File

@@ -43,7 +43,6 @@ static int cmp_counter_names(const void *A, const void *B)
struct counters_args {
char *sysfs_path;
bool tabular;
char __pad[7];
};
static int do_counters(struct counters_args *args)

View File

@@ -26,7 +26,6 @@
struct df_args {
char *path;
bool human_readable;
u8 __pad[7];
};
static int do_df(struct df_args *args)

View File

@@ -9,6 +9,15 @@
#include "cmd.h"
#include "util.h"
/*
* Ensure no compiler-added padding sneaks into structs defined in these
* headers.
*/
#pragma GCC diagnostic error "-Wpadded"
#include "format.h"
#include "ioctl.h"
#pragma GCC diagnostic pop
int main(int argc, char **argv)
{
/*

View File

@@ -107,7 +107,6 @@ struct mkfs_args {
unsigned long long max_meta_size;
unsigned long long max_data_size;
bool force;
char __pad[7];
};
/*

View File

@@ -658,7 +658,6 @@ out:
struct print_recursion_args {
struct scoutfs_super_block *super;
int fd;
u8 __pad[4];
};
/* same as fs item but with a small header in the value */

View File

@@ -24,7 +24,6 @@ struct setattr_args {
u64 data_version;
u64 i_size;
bool offline;
char __pad[7];
};
static int do_setattr(struct setattr_args *args)

View File

@@ -107,7 +107,6 @@ struct stat_args {
char *path;
char *single_field;
bool is_inode;
u8 __pad[7];
};
static int do_stat(struct stat_args *args)