From: Johannes Sixt Date: Wed, 16 Mar 2011 09:09:58 GMT Subject: Re: [PATCH/RFC] reflog: silence -O3 -Wuninitialized warning Message-ID: <4D807E66.40504@viscovery.net> In-Reply-To: <7vfwqnabbi.fsf@alter.siamese.dyndns.org> Am 3/16/2011 6:22, schrieb Junio C Hamano: > I am not suggesting to work this around on the caller side, but I wonder > what effect the usual workaround to tell the compiler that we know it > doesn't understand the validity of this variable by saying: > > unsigned long expire = expire; > > have on this? Well, perhaps the compiler followed the C standard more closely than it is good? By the law, the assignment above provokes undefined behavior, and the compiler is allowed to do anything. I think it's time that you accept patches that turn this into unsigned long expire = 0; -- Hannes