This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Add uninitialized attribute?
- From: Bernd Schmidt <bernds at codesourcery dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, GCC Development <gcc at gcc dot gnu dot org>, "Kreitzer\, David L" <david dot l dot kreitzer at intel dot com>, "Girkar\, Milind" <milind dot girkar at intel dot com>
- Date: Fri, 20 Aug 2010 22:57:32 +0200
- Subject: Re: Add uninitialized attribute?
- References: <AANLkTikiQ3dRQuNjCNHKQk+QQ4pPYj14V-A5Brb0fan7@mail.gmail.com> <mcriq352ek5.fsf@google.com>
On 08/20/2010 10:51 PM, Ian Lance Taylor wrote:
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>
>> Sometime I have to do
>>
>> int x = 0;
>>
>> to silence gcc from uninitialized warnings when I know it is
>> unnecessary. Is that a good idea to add
>>
>> int x __attribute__ ((uninitialized));
>>
>> to tell compiler that it is OK for "x" to be uninitialized?
Better to call it "initialized", analogous to attribute used/unused.
> I think the general idea is reasonable. I also think it might be worth
> spending a few minutes thinking about whether we can implement some more
> general diagnostic suppression mechanism. E.g.,
> int x __attribute__ ((ignore ("-Wuninitialized")));
Or this.
Bernd