I am getting: style/useStlAlgorithm: Consider using std::anyof algorithm instead of a raw loop.
This is OK and I accept this "problem" but I would like to leave this code as it is.
So I am trying to use cppcheck-suppress but where?
I tried different places but none of them suppress this warning.
It will be fixed in cppcheck-2.2 .. you have two options either put the comment on the line before the warning or put the comment on the same line as the warning:
Not sure if I am doing something wrong.
Code example below.
I am getting:
style/useStlAlgorithm: Consider using std::anyof algorithm instead of a raw loop.
This is OK and I accept this "problem" but I would like to leave this code as it is.
So I am trying to use cppcheck-suppress but where?
I tried different places but none of them suppress this warning.
For example (different places for suppression)
None of them suppress this warning. Where should I put this cppcheck-suppress useStlAlgorithm?
It seems likely to me that you want to suppress such warnings in all files. Then using
--suppress=useStlAlgorithm
would be better.hmm.. I fail to inline suppress this warning also.
Last edit: Daniel Marjamäki 2020-09-09
Thank you for your quick response.
In most cases I would like to have this warning enabled that's why I want to suppress only in specific places.
It will be fixed in cppcheck-2.2 .. you have two options either put the comment on the line before the warning or put the comment on the same line as the warning:
Last edit: Daniel Marjamäki 2020-09-11