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?


Hi,

On Fri, 20 Aug 2010, H.J. Lu wrote:

> 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?

int x = x;

is the way GCC offers this idiom since about forever, no need for an 
attribute.  Downthread I see that people worry about this generating an 
actual (uninitialized) access to x.  They are confused.


Ciao,
Michael.


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