]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: tools: avoid a build warning on gcc-4.8 in resolve_sym_name()
authorWilly Tarreau <w@1wt.eu>
Fri, 14 Mar 2025 17:28:32 +0000 (18:28 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 14 Mar 2025 17:30:30 +0000 (18:30 +0100)
A build warning is emitted with gcc-4.8 in tools.c since commit
e920d73f59 ("MINOR: tools: improve symbol resolution without dl_addr")
because the compiler doesn't see that <size> is necessarily initialized.
Let's just preset it.

src/tools.c

index be1de085bff6a0af17450a4da9feaa22c4c0a17d..1f107b3728a5240b4278d3d57b6d64659bf9cd8c 100644 (file)
@@ -5553,7 +5553,7 @@ const void *resolve_sym_name(struct buffer *buf, const char *pfx, const void *ad
        __decl_thread_var(static HA_SPINLOCK_T dladdr_lock);
        int isolated;
        Dl_info dli;
-       size_t size;
+       size_t size = 0;
        const char *fname, *p;
 #endif
        size_t dist, best_dist;