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

Convert 0-sized arrays to true flexible array members #1240

Merged
merged 2 commits into from
May 7, 2024
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
3 changes: 1 addition & 2 deletions auto/modules/wasm
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ NXT_WASM_LDFLAGS=
if [ "$NXT_WASM_RUNTIME" = "wasmtime" ]; then
NXT_WASM_LDFLAGS=-lwasmtime
fi
NXT_WASM_ADDITIONAL_FLAGS="-fno-strict-aliasing \
-Wno-missing-field-initializers \
NXT_WASM_ADDITIONAL_FLAGS="-Wno-missing-field-initializers \
-DNXT_HAVE_WASM_$(echo ${NXT_WASM_RUNTIME} | tr 'a-z' 'A-Z') \
"

Expand Down
14 changes: 7 additions & 7 deletions src/nxt_http_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,29 +103,29 @@ struct nxt_http_route_rule_s {
} name;
} u;

nxt_http_route_pattern_t pattern[0];
nxt_http_route_pattern_t pattern[];
};


typedef struct {
uint32_t items;
nxt_http_route_rule_t *rule[0];
nxt_http_route_rule_t *rule[];
} nxt_http_route_ruleset_t;


typedef struct {
/* The object must be the first field. */
nxt_http_route_object_t object:8;
uint32_t items;
nxt_http_route_ruleset_t *ruleset[0];
nxt_http_route_ruleset_t *ruleset[];
} nxt_http_route_table_t;


struct nxt_http_route_addr_rule_s {
/* The object must be the first field. */
nxt_http_route_object_t object:8;
uint32_t items;
nxt_http_route_addr_pattern_t addr_pattern[0];
nxt_http_route_addr_pattern_t addr_pattern[];
};


Expand All @@ -139,20 +139,20 @@ typedef union {
typedef struct {
uint32_t items;
nxt_http_action_t action;
nxt_http_route_test_t test[0];
nxt_http_route_test_t test[];
} nxt_http_route_match_t;


struct nxt_http_route_s {
nxt_str_t name;
uint32_t items;
nxt_http_route_match_t *match[0];
nxt_http_route_match_t *match[];
};


struct nxt_http_routes_s {
uint32_t items;
nxt_http_route_t *route[0];
nxt_http_route_t *route[];
};


Expand Down
2 changes: 1 addition & 1 deletion src/nxt_upstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct nxt_upstream_s {

struct nxt_upstreams_s {
uint32_t items;
nxt_upstream_t upstream[0];
nxt_upstream_t upstream[];
};


Expand Down
2 changes: 1 addition & 1 deletion src/nxt_upstream_round_robin.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct nxt_upstream_round_robin_server_s {

struct nxt_upstream_round_robin_s {
uint32_t items;
nxt_upstream_round_robin_server_t server[0];
nxt_upstream_round_robin_server_t server[];
};


Expand Down
2 changes: 1 addition & 1 deletion src/python/nxt_python.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ typedef struct {

typedef struct {
nxt_int_t count;
nxt_python_target_t target[0];
nxt_python_target_t target[];
} nxt_python_targets_t;


Expand Down
Loading