diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2020-08-28 19:15:01 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2020-09-01 17:57:50 +0200 |
commit | fd96f1014b11d073d775ea4777f3b3ba2eb93520 (patch) | |
tree | 264f612690b669290b79d04b8b03819b3fc07d64 /base | |
parent | cc2218b4014015bd2633454e683293851183e08c (diff) | |
download | lvm2-fd96f1014b11d073d775ea4777f3b3ba2eb93520.tar.gz |
gcc: zero-sized array to fexlible array C99
Switch remaining zero sized struct to flexible arrays to be C99
complient.
These simple rules should apply:
- The incomplete array type must be the last element within the structure.
- There cannot be an array of structures that contain a flexible array member.
- Structures that contain a flexible array member cannot be used as a member of another structure.
- The structure must contain at least one named member in addition to the flexible array member.
Although some of the code pieces should be still improved.
Diffstat (limited to 'base')
-rw-r--r-- | base/data-struct/hash.c | 2 | ||||
-rw-r--r-- | base/data-struct/radix-tree-adaptive.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/base/data-struct/hash.c b/base/data-struct/hash.c index 0a0541d2e..5ef5ed276 100644 --- a/base/data-struct/hash.c +++ b/base/data-struct/hash.c @@ -22,7 +22,7 @@ struct dm_hash_node { void *data; unsigned data_len; unsigned keylen; - char key[0]; + char key[]; }; struct dm_hash_table { diff --git a/base/data-struct/radix-tree-adaptive.c b/base/data-struct/radix-tree-adaptive.c index b9ba4179f..3a46cc14b 100644 --- a/base/data-struct/radix-tree-adaptive.c +++ b/base/data-struct/radix-tree-adaptive.c @@ -47,7 +47,7 @@ struct value_chain { struct prefix_chain { struct value child; unsigned len; - uint8_t prefix[0]; + uint8_t prefix[]; }; struct node4 { |