Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use flexible array members #3411

Merged
merged 2 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libglusterfs/src/glusterfs/mem-pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct mem_acct_rec {
struct mem_acct {
uint32_t num_types;
gf_atomic_t refcnt;
struct mem_acct_rec rec[0];
struct mem_acct_rec rec[];
};

struct mem_header {
Expand Down Expand Up @@ -297,7 +297,7 @@ typedef struct per_thread_pool_list {
* in the implementation code so we just make it a single-element array
* here.
*/
per_thread_pool_t pools[1];
per_thread_pool_t pools[];
} per_thread_pool_list_t;

/* actual pool structure, shared between different mem_pools */
Expand Down
10 changes: 0 additions & 10 deletions xlators/cluster/dht/src/dht-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -628,16 +628,6 @@ struct dht_dfoffset_ctx {
};
typedef struct dht_dfoffset_ctx dht_dfoffset_ctx_t;

struct dht_disk_layout {
uint32_t cnt;
uint32_t type;
struct {
uint32_t start;
uint32_t stop;
} list[1];
};
typedef struct dht_disk_layout dht_disk_layout_t;

typedef enum {
GF_DHT_MIGRATE_DATA,
GF_DHT_MIGRATE_DATA_EVEN_IF_LINK_EXISTS,
Expand Down
2 changes: 1 addition & 1 deletion xlators/features/changelog/lib/src/gf-changelog-helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct gf_event {

struct list_head list;

struct iovec iov[0];
struct iovec iov[];
};
#define GF_EVENT_CALLOC_SIZE(cnt, len) \
(sizeof(struct gf_event) + (cnt * sizeof(struct iovec)) + len)
Expand Down