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

Joerg Sonnenberger via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 11 15:37:52 PST 2016


On Wed, Feb 10, 2016 at 09:26:44PM -0500, Sidney San Martín via cfe-commits wrote:
> > On Feb 10, 2016, at 8:05 PM, Joerg Sonnenberger <joerg at britannica.bec.de> 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 not useful to programmers who don't know what
> it means in that specific case. Adding parameters to specify a
> specific, useful diagnostic (and maybe deprecating the argument-less
> use), or forking this into two more specific annotations, should resolve things.

I'm fine with introducing a new attribute or even just deducing
automatically that calls to const functions without using the result are
likely pointless under a new warning. I just want to avoid overloading
the existing warning.

Joerg


More information about the cfe-commits mailing list