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

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

 



Johannes Sixt wrote:

> 	unsigned long expire = 0;

The main downside is that that prevents valgrind from discovering when
the variable really is used uninitialized.  But I do agree that

	unsigned long expire = expire;

is ugly, which is part of why I did not use the latter workaround in
this patch.

Since the makefile already controls what options are passed to msvc,
is there some simple way to suppress the warning from "expire =
expire"?  If not, I would find it tempting to make this and similar
examples look like "unsigned long expire;", treat the warning as
evidence that either

 - the code is too complicated or does not give sufficient hints
   to the compiler about control flow, or
 - the compiler has a bug

and use -Wno-uninitialized for -Werror builds.
--
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]