We have a case where we are getting the following error for templated code. There is a template specification for the 0 case which works for the compiler to avoid the problem, but cppcheck doesn't seem to recognize that
Toy.C:17:19: warning: Division by zero. [zerodiv]
return ticket % DIVISOR;
Any chance this can be improved in the parsing or would this be a caase where we have to hard suppress this? Here is the simplified code that still hits it
We have a case where we are getting the following error for templated code. There is a template specification for the 0 case which works for the compiler to avoid the problem, but cppcheck doesn't seem to recognize that
Toy.C:17:19: warning: Division by zero. [zerodiv]
return ticket % DIVISOR;
Any chance this can be improved in the parsing or would this be a caase where we have to hard suppress this? Here is the simplified code that still hits it
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/13041
I guess this is unlikely to get fixed in the short term.
Thank you