Nevermind. I figured out that I need --enable=style. The MISRA checker reports the errors as style so I assume it was on by default. But I duplicated the 'u' causing a false negative.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I found the following consturct in some code that is checked with cppcheck.
The if() will never evaluate to true because its an unsigned comparison. I would have expected cppcheck to catch this but it does not seem to.
weird! There is something about the "0u" in your code. We do warn about this code:
I created https://trac.cppcheck.net/ticket/8836 ... I plan to look at it in the next couple of days.
I think something may be broken with my setup.
I compiled and installed HEAD (43b6a391d) and created the file below.
but I don't get an error.
rsmith@gatito:/home/src/cppcheck.git/ctest$ cppcheck main.c
Checking main.c ...
Nevermind. I figured out that I need --enable=style. The MISRA checker reports the errors as style so I assume it was on by default. But I duplicated the 'u' causing a false negative.