Avoid -Werror=strict-overflow on in rk_dns_srv_order()
commit75829cad18c73a9b74fa1bc5d6c7be29a410ca13
authorAndrew Bartlett <abartlet@samba.org>
Tue, 6 Jul 2021 01:10:16 +0000 (6 13:10 +1200)
committerLuke Howard <lukeh@padl.com>
Fri, 6 Aug 2021 02:24:04 +0000 (6 12:24 +1000)
tree827ace14abd6d85ce2722d05f27c28b9f8f1c185
parent034bc1649d43ca191ee9fdb60a624dbbdf4e6d87
Avoid -Werror=strict-overflow on in rk_dns_srv_order()

In a strict Samba build with -Werror=strict-overflow on Ubuntu 18.04
with gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
we see

../../source4/heimdal/lib/roken/resolve.c: In function ‘rk_dns_srv_order’:
../../source4/heimdal/lib/roken/resolve.c:639:7: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
     if(num_srv == 0)
       ^
cc1: all warnings being treated as errors

This avoids the issue by additionally setting a distinct flag.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
lib/roken/resolve.c