summaryrefslogtreecommitdiff
path: root/libdm
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2021-09-22 17:05:09 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2021-09-22 17:18:50 +0200
commit9eafd44734d32207dce7d0b0829e3c94c07d95c9 (patch)
treef40d8d3b187ea68b5898f87fc04bade87a771d5b /libdm
parent4515acf73430a8734f477b10ae6e3473d02999ae (diff)
downloadlvm2-9eafd44734d32207dce7d0b0829e3c94c07d95c9.tar.gz
gcc: use more zero length arrays
Define last array struct member with zero size.
Diffstat (limited to 'libdm')
-rw-r--r--libdm/datastruct/hash.c2
-rw-r--r--libdm/libdm-common.c2
-rw-r--r--libdm/misc/dm-ioctl.h8
-rw-r--r--libdm/misc/dm-log-userspace.h2
4 files changed, 7 insertions, 7 deletions
diff --git a/libdm/datastruct/hash.c b/libdm/datastruct/hash.c
index 67261f8da..054f5c359 100644
--- a/libdm/datastruct/hash.c
+++ b/libdm/datastruct/hash.c
@@ -20,7 +20,7 @@ struct dm_hash_node {
void *data;
unsigned data_len;
unsigned keylen;
- char key[];
+ char key[0];
};
struct dm_hash_table {
diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c
index 56fb436bc..27be1d02f 100644
--- a/libdm/libdm-common.c
+++ b/libdm/libdm-common.c
@@ -1443,7 +1443,7 @@ struct node_op_parms {
char *old_name;
int warn_if_udev_failed;
unsigned rely_on_udev;
- char names[];
+ char names[0];
};
static void _store_str(char **pos, char **ptr, const char *str)
diff --git a/libdm/misc/dm-ioctl.h b/libdm/misc/dm-ioctl.h
index 55dee2148..52a7a93d1 100644
--- a/libdm/misc/dm-ioctl.h
+++ b/libdm/misc/dm-ioctl.h
@@ -183,7 +183,7 @@ struct dm_target_spec {
struct dm_target_deps {
uint32_t count; /* Array size */
uint32_t padding; /* unused */
- uint64_t dev[]; /* out */
+ uint64_t dev[0]; /* out */
};
/*
@@ -193,7 +193,7 @@ struct dm_name_list {
uint64_t dev;
uint32_t next; /* offset to the next record from
the _start_ of this */
- char name[];
+ char name[0];
};
/*
@@ -203,7 +203,7 @@ struct dm_target_versions {
uint32_t next;
uint32_t version[3];
- char name[];
+ char name[0];
};
/*
@@ -212,7 +212,7 @@ struct dm_target_versions {
struct dm_target_msg {
uint64_t sector; /* Device sector */
- char message[];
+ char message[0];
};
/*
diff --git a/libdm/misc/dm-log-userspace.h b/libdm/misc/dm-log-userspace.h
index b243194d9..f28fa585e 100644
--- a/libdm/misc/dm-log-userspace.h
+++ b/libdm/misc/dm-log-userspace.h
@@ -412,7 +412,7 @@ struct dm_ulog_request {
uint32_t request_type; /* DM_ULOG_* defined above */
uint32_t data_size; /* How much data (not including this struct) */
- char data[];
+ char data[0];
};
#endif /* __DM_LOG_USERSPACE_H__ */