1
0
Fork 0
remarkable-linux/lib/lz4
Greg Kroah-Hartman 529ada21ff lz4: fix bogus gcc warning
When building lz4 under gcc-7 we get the following bogus warning:

  CC [M]  lib/lz4/lz4hc_compress.o
lib/lz4/lz4hc_compress.c: In function ‘lz4hc_compress’:
lib/lz4/lz4hc_compress.c:179:42: warning: ‘delta’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    chaintable[(size_t)(ptr) & MAXD_MASK] = delta;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
lib/lz4/lz4hc_compress.c:134:6: note: ‘delta’ was declared here
  u16 delta;
      ^~~~~

This doesn't show up in the 4.4-stable tree due to us turning off
warnings like this.  It also doesn't show up in newer kernel versions as
this code was totally rewritten.

So for now, to get the 4.9-stable tree to build with 0 warnings on x86
allmodconfig, let's just shut the compiler up by initializing the
variable to 0, despite it not really doing anything.

To be far, this code is crazy complex, so the fact that gcc can't
determine if the variable is really used or not isn't that bad, I'd
blame the code here instead of the compiler.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-02 07:07:54 +02:00
..
Makefile lib: add lz4 compressor module 2013-07-09 10:33:30 -07:00
lz4_compress.c lib/lz4: correct the LZ4 license 2013-08-23 09:51:22 -07:00
lz4_decompress.c lz4: fix system halt at boot kernel on x86_64 2015-05-24 11:56:29 -07:00
lz4defs.h lib: lz4: cleanup unaligned access efficiency detection 2016-04-13 09:22:49 -07:00
lz4hc_compress.c lz4: fix bogus gcc warning 2017-09-02 07:07:54 +02:00