It looks like I was running a much older version (v2.13.0 from 2023) because that is what Ubuntu apt install gives currently. But I have now manually installed v2.19.0 and this issue is fixed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think this is a false positive.
style: Checking if unsigned expression 'n' is less than zero.
[unsignedLessThanZero] if(n < 0) throw out_of_range("n < 0 not
allowed!");
-Doug
Last edit: DougCube 6 days ago
Should be covered by https://trac.cppcheck.net/ticket/12387
It looks like I was running a much older version (v2.13.0 from 2023) because that is what Ubuntu apt install gives currently. But I have now manually installed v2.19.0 and this issue is fixed.