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

2016-04-05 Thread Sidney San Martín via cfe-commits
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

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

2016-02-10 Thread Sidney San Martín via cfe-commits
> On Feb 10, 2016, at 8:05 PM, Joerg Sonnenberger > wrote: > > I'm not a big fan of this. Those calls are by the very definition > harmless, so they aggrevate the existing problem of stupid annotation. The issue is that the annotation's current diagnostic is pretty nonspecific and therefore no

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

2016-02-10 Thread Sidney San Martín via cfe-commits
sidney added a comment. In http://reviews.llvm.org/D17043#348982, @alexfh wrote: > The attribute can have arguments (e.g. `[[deprecated("use some other API")]] > void f();`), so if there is a good reason, an argument (e.g. a custom > message) can be added to the `warn_unused_result` attribute.

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

2016-02-10 Thread Sidney San Martín via cfe-commits
sidney added a comment. In http://reviews.llvm.org/D17043#348525, @alexfh wrote: > I'd like to note that there is a library-side way to mitigate this issue > using the `[[clang::warn_unused_result]]` attribute on `vector::empty()` and > similar methods: Using an attribute sounds much better t

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

2016-02-10 Thread Sidney San Martín via cfe-commits
sidney created this revision. sidney added reviewers: mclow.lists, alexfh. sidney added a subscriber: cfe-commits. Currently has a whitelist of methods like std::vector::empty() which, in a standalone statement, likely won't do what the programmer wants. The whitelist is brittle (Did I misspell a

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

2016-02-10 Thread Sidney San Martín via cfe-commits
sidney added a comment. Quick note: this is my first contribution, born from the Clang/LLVM sprint last weekend. Marshall helped me get started. http://reviews.llvm.org/D17043 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llv