On 11/08/2012 08:43 PM, Lubos Lunak wrote:
The patch implements an attribute for marking types for which gcc cannot on its own issue warnings about unused variables (e.g. because the ctor is external), but for which such a warning might be useful anyway (e.g. std::string).
I'm not sure if the default shouldn't be "warn". RAII-only classes which are used purely for constructor/destructor side effects are pretty rare, AFAICT.
To make this useful with containers, we'd need further annotations to tell read and write accesses apart. (A vector might be append-only, and the elements might be ignored.)
-- Florian Weimer / Red Hat Product Security Team