[prev in list] [next in list] [prev in thread] [next in thread]
List: gcc-patches
Subject: Re: [PATCH] Attribute for unused warning for variables of non-trivial types
From: Gabriel Dos Reis <gdr () integrable-solutions ! net>
Date: 2012-11-09 15:56:14
Message-ID: CAAiZkiC+3fj+BEmJQRpxTc-k_meoEuay3gXfx8uhNTLpW5CoDg () mail ! gmail ! com
[Download RAW message or body]
On Fri, Nov 9, 2012 at 5:08 AM, Florian Weimer <fweimer@redhat.com> wrote:
> 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
I am also concerned that an idiomatic standard C++ program would need
obscure annotations to silence GCC.
-- Gaby
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic