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 10-08-20 15:42 , H.J. Lu wrote:
Hi,

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?

Seems to me that there is a lot less typing with the '= 0' variant.


However, there have been several instances (particularly in C++) where providing an initial value is somewhat more convoluted.


Diego.



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