Coverity Prevent: how to handle the “checked return” warning when I intentionally do not check the return?

As the name implies, for example, in 85% of the situation, I would like to check the return code foo (), but sometimes it’s really not interesting for me, but it will cause a Coverity warning.

What is the best way to deal with this problem? Changing the cover settings is not taken into account. :)

+4
source share
1 answer

The correct way to suppress a CHECKED_RETURN defect is to specify a return value that you do not care about void. This has the added benefit of allowing everyone who reads code that you don't like in the return value to understand, rather than forgetting to check it.

+7
source

Source: https://habr.com/ru/post/1340719/


All Articles