mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
fix(wpa_supplicant): fix unused-but-set-variable warnings with GCC 16
GCC 16 raised the default level of -Wunused-but-set-variable and now flags variables that are only used to update themselves. Remove the 'removed' counter in pmksa_cache_flush() (its only read was commented out) and mark the EAP-FAST PAC entry counters as unused, since their only read is inside wpa_printf(MSG_DEBUG, ...) which compiles to a no-op when debug logging is disabled.
This commit is contained in:
@@ -414,7 +414,8 @@ int eap_fast_load_pac(struct eap_sm *sm, struct eap_fast_pac **pac_root,
|
|||||||
{
|
{
|
||||||
struct eap_fast_read_ctx rc;
|
struct eap_fast_read_ctx rc;
|
||||||
struct eap_fast_pac *pac = NULL;
|
struct eap_fast_pac *pac = NULL;
|
||||||
int count = 0;
|
/* count is only consumed by debug logging */
|
||||||
|
int count __attribute__((unused)) = 0;
|
||||||
char *pos;
|
char *pos;
|
||||||
const char *err = NULL;
|
const char *err = NULL;
|
||||||
|
|
||||||
@@ -623,7 +624,9 @@ int eap_fast_save_pac(struct eap_sm *sm, struct eap_fast_pac *pac_root,
|
|||||||
const char *pac_file)
|
const char *pac_file)
|
||||||
{
|
{
|
||||||
struct eap_fast_pac *pac;
|
struct eap_fast_pac *pac;
|
||||||
int ret, count = 0;
|
int ret;
|
||||||
|
/* count is only consumed by debug logging */
|
||||||
|
int count __attribute__((unused)) = 0;
|
||||||
char *buf, *pos;
|
char *buf, *pos;
|
||||||
size_t buf_len;
|
size_t buf_len;
|
||||||
|
|
||||||
@@ -754,7 +757,9 @@ int eap_fast_load_pac_bin(struct eap_sm *sm, struct eap_fast_pac **pac_root,
|
|||||||
{
|
{
|
||||||
const struct wpa_config_blob *blob = NULL;
|
const struct wpa_config_blob *blob = NULL;
|
||||||
u8 *buf, *end, *pos;
|
u8 *buf, *end, *pos;
|
||||||
size_t len, count = 0;
|
size_t len;
|
||||||
|
/* count is only consumed by debug logging */
|
||||||
|
size_t count __attribute__((unused)) = 0;
|
||||||
struct eap_fast_pac *pac, *prev;
|
struct eap_fast_pac *pac, *prev;
|
||||||
|
|
||||||
*pac_root = NULL;
|
*pac_root = NULL;
|
||||||
@@ -876,7 +881,9 @@ parse_fail:
|
|||||||
int eap_fast_save_pac_bin(struct eap_sm *sm, struct eap_fast_pac *pac_root,
|
int eap_fast_save_pac_bin(struct eap_sm *sm, struct eap_fast_pac *pac_root,
|
||||||
const char *pac_file)
|
const char *pac_file)
|
||||||
{
|
{
|
||||||
size_t len, count = 0;
|
size_t len;
|
||||||
|
/* count is only consumed by debug logging */
|
||||||
|
size_t count __attribute__((unused)) = 0;
|
||||||
struct eap_fast_pac *pac;
|
struct eap_fast_pac *pac;
|
||||||
u8 *buf, *pos;
|
u8 *buf, *pos;
|
||||||
|
|
||||||
|
|||||||
@@ -280,7 +280,6 @@ void pmksa_cache_flush(struct rsn_pmksa_cache *pmksa, void *network_ctx,
|
|||||||
const u8 *pmk, size_t pmk_len)
|
const u8 *pmk, size_t pmk_len)
|
||||||
{
|
{
|
||||||
struct rsn_pmksa_cache_entry *entry, *prev = NULL, *tmp;
|
struct rsn_pmksa_cache_entry *entry, *prev = NULL, *tmp;
|
||||||
int removed = 0;
|
|
||||||
|
|
||||||
entry = pmksa->pmksa;
|
entry = pmksa->pmksa;
|
||||||
while (entry) {
|
while (entry) {
|
||||||
@@ -298,14 +297,11 @@ void pmksa_cache_flush(struct rsn_pmksa_cache *pmksa, void *network_ctx,
|
|||||||
tmp = entry;
|
tmp = entry;
|
||||||
entry = entry->next;
|
entry = entry->next;
|
||||||
pmksa_cache_free_entry(pmksa, tmp, PMKSA_FREE);
|
pmksa_cache_free_entry(pmksa, tmp, PMKSA_FREE);
|
||||||
removed++;
|
|
||||||
} else {
|
} else {
|
||||||
prev = entry;
|
prev = entry;
|
||||||
entry = entry->next;
|
entry = entry->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*if (removed)
|
|
||||||
pmksa_cache_set_expiration(pmksa);*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user