Can a flag can be set with splint to detect this logic fault?
if((a > 0) && (a == 0)){...}
The 2nd variable a is a typo. It's supposed to be b.
I've tried +ifempty and +ifblock and it turns out that they are for something else. Any suggestions? Or is it beyond splint?
PVS-Studio can find such an error using the V560 diagnostic. Example: https://godbolt.org/z/JA-Kmm