This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Attribute for unused warning for variables of non-trivial types
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: Lubos Lunak <l dot lunak at suse dot cz>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 9 Nov 2012 09:56:14 -0600
- Subject: Re: [PATCH] Attribute for unused warning for variables of non-trivial types
- References: <email@example.com> <509CE44B.firstname.lastname@example.org>
On Fri, Nov 9, 2012 at 5:08 AM, Florian Weimer <email@example.com> wrote:
> On 11/08/2012 08:43 PM, Lubos Lunak wrote:
>> The patch implements an attribute for marking types for which gcc cannot
>> 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.
> 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,
> 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
I am also concerned that an idiomatic standard C++ program would need
obscure annotations to silence GCC.