1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

gcc: use more zero length arrays

Define last array struct member with zero size.
This commit is contained in:
Zdenek Kabelac 2021-09-22 17:05:09 +02:00
parent 4515acf734
commit 9eafd44734
10 changed files with 16 additions and 16 deletions

View File

@ -23,7 +23,7 @@ struct dm_hash_node {
unsigned data_len; unsigned data_len;
unsigned keylen; unsigned keylen;
unsigned hash; unsigned hash;
char key[]; char key[0];
}; };
struct dm_hash_table { struct dm_hash_table {

View File

@ -1445,7 +1445,7 @@ struct node_op_parms {
char *old_name; char *old_name;
int warn_if_udev_failed; int warn_if_udev_failed;
unsigned rely_on_udev; unsigned rely_on_udev;
char names[]; char names[0];
}; };
static void _store_str(char **pos, char **ptr, const char *str) static void _store_str(char **pos, char **ptr, const char *str)

View File

@ -183,7 +183,7 @@ struct dm_target_spec {
struct dm_target_deps { struct dm_target_deps {
uint32_t count; /* Array size */ uint32_t count; /* Array size */
uint32_t padding; /* unused */ uint32_t padding; /* unused */
uint64_t dev[]; /* out */ uint64_t dev[0]; /* out */
}; };
/* /*
@ -193,7 +193,7 @@ struct dm_name_list {
uint64_t dev; uint64_t dev;
uint32_t next; /* offset to the next record from uint32_t next; /* offset to the next record from
the _start_ of this */ the _start_ of this */
char name[]; char name[0];
}; };
/* /*
@ -203,7 +203,7 @@ struct dm_target_versions {
uint32_t next; uint32_t next;
uint32_t version[3]; uint32_t version[3];
char name[]; char name[0];
}; };
/* /*
@ -212,7 +212,7 @@ struct dm_target_versions {
struct dm_target_msg { struct dm_target_msg {
uint64_t sector; /* Device sector */ uint64_t sector; /* Device sector */
char message[]; char message[0];
}; };
/* /*

View File

@ -313,7 +313,7 @@ struct fs_op_parms {
char *lv_name; char *lv_name;
char *dev; char *dev;
char *old_lv_name; char *old_lv_name;
char names[]; char names[0];
}; };
static void _store_str(char **pos, char **ptr, const char *str) static void _store_str(char **pos, char **ptr, const char *str)

View File

@ -39,7 +39,7 @@ struct dev_iter {
struct dir_list { struct dir_list {
struct dm_list list; struct dm_list list;
char dir[]; char dir[0];
}; };
static struct { static struct {

View File

@ -44,7 +44,7 @@ struct labeller_i {
struct dm_list list; struct dm_list list;
struct labeller *l; struct labeller *l;
char name[]; char name[0];
}; };
static struct dm_list _labellers; static struct dm_list _labellers;

View File

@ -20,7 +20,7 @@ struct dm_hash_node {
void *data; void *data;
unsigned data_len; unsigned data_len;
unsigned keylen; unsigned keylen;
char key[]; char key[0];
}; };
struct dm_hash_table { struct dm_hash_table {

View File

@ -1443,7 +1443,7 @@ struct node_op_parms {
char *old_name; char *old_name;
int warn_if_udev_failed; int warn_if_udev_failed;
unsigned rely_on_udev; unsigned rely_on_udev;
char names[]; char names[0];
}; };
static void _store_str(char **pos, char **ptr, const char *str) static void _store_str(char **pos, char **ptr, const char *str)

View File

@ -183,7 +183,7 @@ struct dm_target_spec {
struct dm_target_deps { struct dm_target_deps {
uint32_t count; /* Array size */ uint32_t count; /* Array size */
uint32_t padding; /* unused */ uint32_t padding; /* unused */
uint64_t dev[]; /* out */ uint64_t dev[0]; /* out */
}; };
/* /*
@ -193,7 +193,7 @@ struct dm_name_list {
uint64_t dev; uint64_t dev;
uint32_t next; /* offset to the next record from uint32_t next; /* offset to the next record from
the _start_ of this */ the _start_ of this */
char name[]; char name[0];
}; };
/* /*
@ -203,7 +203,7 @@ struct dm_target_versions {
uint32_t next; uint32_t next;
uint32_t version[3]; uint32_t version[3];
char name[]; char name[0];
}; };
/* /*
@ -212,7 +212,7 @@ struct dm_target_versions {
struct dm_target_msg { struct dm_target_msg {
uint64_t sector; /* Device sector */ uint64_t sector; /* Device sector */
char message[]; char message[0];
}; };
/* /*

View File

@ -412,7 +412,7 @@ struct dm_ulog_request {
uint32_t request_type; /* DM_ULOG_* defined above */ uint32_t request_type; /* DM_ULOG_* defined above */
uint32_t data_size; /* How much data (not including this struct) */ uint32_t data_size; /* How much data (not including this struct) */
char data[]; char data[0];
}; };
#endif /* __DM_LOG_USERSPACE_H__ */ #endif /* __DM_LOG_USERSPACE_H__ */