mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02:00
BUILD: peers: fix build warning with gcc 4.2.1
Building on OpenBSD 6.7 with gcc-4.2.1 yields the following warnings which suggest that the initialization is not taken as expected but that the container member is reset with each initialization: src/peers.c: In function 'peer_send_updatemsg': src/peers.c:1000: warning: initialized field overwritten src/peers.c:1000: warning: (near initialization for 'p.updt') src/peers.c:1001: warning: initialized field overwritten src/peers.c:1001: warning: (near initialization for 'p.updt') src/peers.c:1002: warning: initialized field overwritten src/peers.c:1002: warning: (near initialization for 'p.updt') src/peers.c:1003: warning: initialized field overwritten src/peers.c:1003: warning: (near initialization for 'p.updt') src/peers.c:1004: warning: initialized field overwritten src/peers.c:1004: warning: (near initialization for 'p.updt') Fixing this is trivial, we just have to initialize one level at a time.
This commit is contained in:
parent
45e83e8c56
commit
a898f0c6ff
14
src/peers.c
14
src/peers.c
@ -995,12 +995,14 @@ static inline int peer_send_updatemsg(struct shared_table *st, struct appctx *ap
|
||||
unsigned int updateid, int use_identifier, int use_timed)
|
||||
{
|
||||
struct peer_prep_params p = {
|
||||
.updt.stksess = ts,
|
||||
.updt.shared_table = st,
|
||||
.updt.updateid = updateid,
|
||||
.updt.use_identifier = use_identifier,
|
||||
.updt.use_timed = use_timed,
|
||||
.updt.peer = appctx->ctx.peers.ptr,
|
||||
.updt = {
|
||||
.stksess = ts,
|
||||
.shared_table = st,
|
||||
.updateid = updateid,
|
||||
.use_identifier = use_identifier,
|
||||
.use_timed = use_timed,
|
||||
.peer = appctx->ctx.peers.ptr,
|
||||
},
|
||||
};
|
||||
|
||||
return peer_send_msg(appctx, peer_prepare_updatemsg, &p);
|
||||
|
Loading…
x
Reference in New Issue
Block a user