[PATCH] D17043: Check that the result of a library call w/o side effects is used

Sidney San Martín via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 5 10:16:44 PDT 2016


sidney added a comment.

In http://reviews.llvm.org/D17043#390188, @alexfh wrote:

> What's the status of this patch? Do you still want to continue working on it or are you fine with the warn_unused_result/nodiscard-based solution?


I'm still interested in working on this, but I was waiting for y'all (maybe Richard?).

IMHO, the current diagnostic for `warn_unused_result` is confusing (see the Google search and examples above <http://reviews.llvm.org/D17043#348569>). Adding a parameter sounds great as long as it supports both canned answers (e.g. `nodiscard(nosideeffects)`), to avoid having the same message in many places, and literal strings (`e.g. nodiscard("recv() returns the length of the received message, its return value should always be used.")`).

If that won't happen and you all don't have a better idea, I can keep working on this patch.


http://reviews.llvm.org/D17043





More information about the cfe-commits mailing list