Thanks for your report.
I have tried to reproduce it with Cppcheck V1.83 and the latest development version but i do not get any negativeShift or other wrong message. I tried it without Cppcheck knowing the macro and with the define, but in both cases i do not get a negativeShift message.
What version of Cppcheck do you use?
Do you still get the message for the reduced example or only in a project?
If it happens with the latest version and the reduced example maybe the parameters you provide to Cppcheck matter, can you give details about that?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In our project we have a macro something like this:
#define TRACE(level, output) do { if (level <= traceLevel) cerr << output << endl;}while(false);
when this macro is called like this:
We get the error negativeShift.
Similarly happens with BOOST_MESSAGE from the boost unit library.
Is there a suggested way to avoid this?
Thankyou.
Thanks for your report.
I have tried to reproduce it with Cppcheck V1.83 and the latest development version but i do not get any negativeShift or other wrong message. I tried it without Cppcheck knowing the macro and with the define, but in both cases i do not get a negativeShift message.
What version of Cppcheck do you use?
Do you still get the message for the reduced example or only in a project?
If it happens with the latest version and the reduced example maybe the parameters you provide to Cppcheck matter, can you give details about that?