On 04.01.2024 16:33, Jan Beulich wrote: > On 04.01.2024 15:33, Andrew Cooper wrote: >> On 04/01/2024 1:41 pm, Jan Beulich wrote: >>> Furthermore this initialize-to-self is a well known pattern to suppress the >>> -Wuninitialized induced warnings, originally used by Linux'es >>> uninitialized_var(). >> >> I'm glad you cited this, because it proves my point. >> >> Notice how it was purged from Linux slowly over the course of 8 years >> because it had been shown to create real bugs, by hiding real uses of >> uninitialised variables. > > I'm fully aware of this. The construct was used wrongly in too many cases. > Still I recall times where I was actively asked to use the construct.
And, btw: The construct was (meant to be) used in particular for suppressing false-positive -Wuninitialized warnings on, in particular, older gcc. Which means that by enabling this option we may also subsequently need to deal with fallout. I'm not convinced we want to uniformly do so by adding "normal" initializers wherever (not really) needed. Jan