From: Tobias Brunner Date: Thu, 16 Jun 2022 08:23:16 +0000 (+0200) Subject: hashtable: Avoid compiler warning with GCC 12 X-Git-Tag: 5.9.7dr2~9 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=585666aa974a4e751766c327139c982c58912090;p=thirdparty%2Fstrongswan.git hashtable: Avoid compiler warning with GCC 12 Even though the assignment of `removed` to `out_row` is tied to the `found_removed` flag, which is only set if `removed` is set, the compiler complains that it may be used uninitialized. --- diff --git a/src/libstrongswan/collections/hashtable.c b/src/libstrongswan/collections/hashtable.c index fa1e4a0937..809650a531 100644 --- a/src/libstrongswan/collections/hashtable.c +++ b/src/libstrongswan/collections/hashtable.c @@ -289,7 +289,7 @@ static inline pair_t *find_key(private_hashtable_t *this, const void *key, u_int *out_hash, u_int *out_row) { pair_t *pair; - u_int hash, row, p = 0, removed, index; + u_int hash, row, p = 0, removed = 0, index; bool found_removed = FALSE; if (!this->count && !out_hash && !out_row)