]> git.ipfire.org Git - thirdparty/bind9.git/commit
add spatch to detect implicit bool/int/result cast
authorColin Vidal <colin@isc.org>
Tue, 14 Oct 2025 10:45:21 +0000 (12:45 +0200)
committerColin Vidal (GitLab job 6470718) <colin@isc.org>
Wed, 12 Nov 2025 10:32:19 +0000 (10:32 +0000)
commit6bc903263a037d7eae53deb1b9f671bb092584dd
tree4cbb48e3f215baca19f64dfb7a1e4edd11eba4d9
parentf4351443a3564ce8eecd2ed98dd7a66c161301d5
add spatch to detect implicit bool/int/result cast

Detection of implicit cast from a boolean into an int, or an
isc_result_t into a boolean (either in an assignement or return
position).

If such pattern is found, a warning comment is added into the code (and
the CI will fails) so the error can be spotted and manually fixed.

(cherry picked from commit 754595ea2d9aee4e789d6fc0f295f64f0e2312d6)
cocci/implicit_casts_warning.spatch [new file with mode: 0644]