Mark Mitchell wrote:
Bernd Schmidt wrote:

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 agree.

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.

FWIW, I think that's overly ambitious.


There is already an "optimise" function __attribute__ and matching #pragma's that temporarily change the optimisation flags for a function (and a similar set for target flags). For warning messages, there are #pragma's (though no push/pop pragma, AFAIK). Would it be practical to have a "diagnostic" function __attribute__ in the same style? Then at least it would be possible to declare __attribute__((diagnostic("-Wno-uninitialized"))) on the function in question.


Reply via email to