diff options
author | Valentin Bartenev <vbart@nginx.com> | 2021-02-01 18:55:49 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2021-02-01 18:55:49 +0300 |
commit | 93ac087e9684c63f82df36f847bf9239e2eb185e (patch) | |
tree | bce4aec3c370524bfa3f939e390b763d928f882f /src | |
parent | 510bdf15bec094d49be8aba63e56963aed5746cf (diff) | |
download | unit-93ac087e9684c63f82df36f847bf9239e2eb185e.tar.gz unit-93ac087e9684c63f82df36f847bf9239e2eb185e.tar.bz2 |
Fixed building by GCC 10 with -flto and -O2.
This closes #467 issue on GitHub.
Diffstat (limited to 'src')
-rw-r--r-- | src/nxt_http_route.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nxt_http_route.c b/src/nxt_http_route.c index 9aaa708e..28545fc9 100644 --- a/src/nxt_http_route.c +++ b/src/nxt_http_route.c @@ -813,6 +813,12 @@ nxt_http_route_ruleset_create(nxt_task_t *task, nxt_mp_t *mp, next = 0; + /* + * A workaround for GCC 10 with -flto -O2 flags that warns about "name" + * may be uninitialized in nxt_http_route_rule_name_create(). + */ + nxt_str_null(&name); + for (i = 0; i < n; i++) { rule_cv = nxt_conf_next_object_member(ruleset_cv, &name, &next); |