rollbear / trompeloeil

Header only C++14 mocking framework
Boost Software License 1.0
802 stars 85 forks source link

can this cppcheck inline suppression be added #326

Open killerbot242 opened 9 months ago

killerbot242 commented 9 months ago

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

rollbear commented 9 months ago

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.