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.

MFC after:	3 days
This commit is contained in:
Dimitry Andric 2020-01-29 21:40:35 +00:00
parent bb1d0df511
commit 3fd49cf90e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/clang1000-import/; revision=357271

View file

@ -1232,9 +1232,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;