summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2024-10-16 12:24:44 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2024-10-16 13:30:25 +0200
commitc071b4370d84ef9857cb1dec60b8f916ceefc476 (patch)
tree54a33c6856af1e36846ed518d10ecb96273940bf
parent49cf311d46bed1b656251c1aa259f4f043095a9c (diff)
*: 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 <equinox@opensourcerouting.org>
-rw-r--r--lib/zlog_5424_cli.c1
-rw-r--r--zebra/zebra_nb_state.c1
2 files changed, 2 insertions, 0 deletions
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";