This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Add uninitialized attribute?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]