This is nice.
You are right, we running Cppcheck without Style messages and thus did not get this those messages.
However, for me, it does not look like a style issue for me. It is a real bug that must be fixed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is nice.
You are right, we running Cppcheck without Style messages and thus did not get this those messages.
However, for me, it does not look like a style issue for me. It is a real bug that must be fixed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For cppcheck it's hard to determine if such comparisons are bugs or written like that by intention.
We only use warning/error severities if the code might have undefined behavior and that is not the case here. So well in Cppcheck, the motivation for most style checks are that there could be some bug.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the response and explanations.
However, I added 'unsignedLessThanZero' check on my code and in most of cases it notifies the message on comparison such as 'u<= 0'.
I agree that 'u<= 0' is really a style.
IMO 'u<0' is different from 'u<=0' and it should be a warning message.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When comparing "unsigned int < 0", it is expected to get a warning that expression always evaluated to false.
Works for me:
This is nice.
You are right, we running Cppcheck without Style messages and thus did not get this those messages.
However, for me, it does not look like a style issue for me. It is a real bug that must be fixed.
This is nice.
You are right, we running Cppcheck without Style messages and thus did not get this those messages.
However, for me, it does not look like a style issue for me. It is a real bug that must be fixed.
For cppcheck it's hard to determine if such comparisons are bugs or written like that by intention.
We only use
warning
/error
severities if the code might have undefined behavior and that is not the case here. So well in Cppcheck, the motivation for moststyle
checks are that there could be some bug.Thanks for the response and explanations.
However, I added 'unsignedLessThanZero' check on my code and in most of cases it notifies the message on comparison such as 'u<= 0'.
I agree that 'u<= 0' is really a style.
IMO 'u<0' is different from 'u<=0' and it should be a warning message.