Can you confirm that 2.9 does not give this error ?
My test suggest that cppcheck --enable=style gives this problem at least at far back as 2.6 for Tobias's code with c<160
Last edit: Andrew C Aitchison 2023-02-02
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Below "Condition is always true" false positive occurs since cppcheck 2.10:
Thanks for reporting, I think this is covered by https://trac.cppcheck.net/ticket/11437
Here another false-positive (never seen this with 2.9.) that's maybe related:
When removing the c<160 condition the error goes away.
That seems to be a different issue, ticket: https://trac.cppcheck.net/ticket/11532
Can you confirm that 2.9 does not give this error ?
My test suggest that cppcheck --enable=style gives this problem at least at far back as 2.6 for Tobias's code with c<160
Last edit: Andrew C Aitchison 2023-02-02
I can't confirm this.
It may be possible that some internalASTError (that are no fixed) prevented this error for me with 2.9.