trompeloeil icon indicating copy to clipboard operation
trompeloeil copied to clipboard

can this cppcheck inline suppression be added

Open killerbot242 opened this issue 2 years ago • 1 comments

in the method trace_exception a (re) throw correctly occurs. Cppcheck tries to find 'empty' throws in a non-rethrown scenario and warns about them (aka this equals to std::terminate). It gives a false positive on the line in 'trace_exception'.

The solution is very trivial:

change the line into: throw; // cppcheck-suppress rethrowNoCurrentException

killerbot242 avatar Nov 25 '23 14:11 killerbot242

Is there any other way of suppressing this than to clutter the sources?

I feel very uneasy about this kind of "fix", because there are many static checkers, and they all have their false positives and their ways of suppressing them, and I fear where this may lead.

rollbear avatar Nov 28 '23 06:11 rollbear