From 65a88ae57356ea49065b3aa2c62ec4d043233a34 Mon Sep 17 00:00:00 2001 From: dim Date: Tue, 4 Feb 2020 19:35:40 +0000 Subject: [PATCH] MFC r357272: Merge r357271 from the clang1000-import branch: Fix the following -Werror warning from clang 10.0.0 in bsnmpd: usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c:1235:43: error: overlapping comparisons always evaluate to true [-Werror,-Wtautological-overlap-compare] begemotBridgeStpPortEnable_enabled || ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ Work around it by casting the enum values to the type of val->v.integer. git-svn-id: svn://svn.freebsd.org/base/stable/10@357520 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c b/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c index cbb8dc894..bb0f539a1 100644 --- a/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c +++ b/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c @@ -1229,9 +1229,9 @@ op_begemot_stp_port(struct snmp_context *ctx, struct snmp_value *val, case LEAF_begemotBridgeStpPortEnable: if (val->v.integer != - begemotBridgeStpPortEnable_enabled || + (int32_t)begemotBridgeStpPortEnable_enabled || val->v.integer != - begemotBridgeStpPortEnable_disabled) + (int32_t)begemotBridgeStpPortEnable_disabled) return (SNMP_ERR_WRONG_VALUE); ctx->scratch->int1 = bp->enable; -- 2.42.0