Re: [PATCH] Avoid gcc compiler warning

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

 



On Mon, Dec 08, 2014 at 05:38:59PM +0100, Johannes Schindelin wrote:

> At least on this developer's MacOSX (Snow Leopard, gcc-4.2.1), GCC prints
> a warning that 'hash' may be used uninitialized when compiling
> test-hashmap that 'hash' may be used uninitialized (but GCC 4.6.3 on this
> developer's Ubuntu server does not report this problem).
> 
> Since hash() is called from perf_hashmap() which accepts an unchecked
> integer value from the command line, the warning appears to be legitimate,
> even if the test-hashmap command is only called from the test suite.

I think the older gcc is wrong; we are switching on "method & 3", which
must be in the range 0-3 (and we cover all cases).

I do not mind silencing the warning anyway, but see this discussion:

  http://thread.gmane.org/gmane.comp.version-control.git/258186

The thread seems very broken in gmane, but it continues here:

  http://article.gmane.org/gmane.comp.version-control.git/258232

  http://thread.gmane.org/gmane.comp.version-control.git/258245

  http://article.gmane.org/gmane.comp.version-control.git/258264

-Peff
--
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]