Re: [PATCH/RFC] reflog: silence -O3 -Wuninitialized warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]