From c071b4370d84ef9857cb1dec60b8f916ceefc476 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Wed, 16 Oct 2024 12:24:44 +0200 Subject: [PATCH] *: clang-SA switch-enum initializer workarounds In these cases the value assigned by the switch block is used directly rather than returned. Mark the initial/default value as used so clang-SA doesn't complain about it. Signed-off-by: David Lamparter --- lib/zlog_5424_cli.c | 1 + zebra/zebra_nb_state.c | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/zlog_5424_cli.c b/lib/zlog_5424_cli.c index 3003df542f..f97c426463 100644 --- a/lib/zlog_5424_cli.c +++ b/lib/zlog_5424_cli.c @@ -674,6 +674,7 @@ static int log_5424_config_write(struct vty *vty) vty_out(vty, "log extended %s\n", cfg->name); + (void)fmt_str; /* clang-SA */ switch (cfg->cfg.fmt) { case ZLOG_FMT_5424: fmt_str = " format rfc5424"; diff --git a/zebra/zebra_nb_state.c b/zebra/zebra_nb_state.c index 63ac7877d0..6ed11f75f1 100644 --- a/zebra/zebra_nb_state.c +++ b/zebra/zebra_nb_state.c @@ -900,6 +900,7 @@ lib_vrf_zebra_ribs_rib_route_route_entry_nexthop_group_nexthop_bh_type_get_elem( if (nexthop->type != NEXTHOP_TYPE_BLACKHOLE) return NULL; + (void)type_str; /* clang-SA */ switch (nexthop->bh_type) { case BLACKHOLE_NULL: type_str = "null";