From 073292315f42e76d7a19f9e33afc9d28cbd50136 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Fri, 6 Oct 2023 23:21:48 -0500 Subject: [PATCH] band: Silence warning width must be initialized since it depends on best not being NULL. If best passes the non-NULL check above, then width must be initialized since both width and best are set at the same time. --- src/band.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/band.c b/src/band.c index 486df6e1..bf40f789 100644 --- a/src/band.c +++ b/src/band.c @@ -1260,7 +1260,10 @@ int band_freq_to_ht_chandef(uint32_t freq, const struct band_freq_attrs *attr, * - 40mhz we can base the selection off the channel flags, either * higher or lower. */ +_Pragma("GCC diagnostic push") +_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") switch (width) { +_Pragma("GCC diagnostic pop") case BAND_CHANDEF_WIDTH_20: return 0; case BAND_CHANDEF_WIDTH_40: