lib: zlib_inflate "r.base" uninitialized compile warnings
PATCH 1/1 lib: zlib_inflate "r.base" uninitialized compile warnings
Eliminates compile-time warnings from "r" being uninitialized.
---
lib/zlib_inflate/inftrees.c renamed from lib/zlib_inflate/inftrees.c.orig +1 -0
@@ -196,6 +196,7 @@ static int huft_build( u[0 ] =NULL ;/* just to keep compilers happy */ q =NULL ;/* ditto */ z =0 ;/* ditto */ + r.word.pad = r.base =0 ;/* ditto */ /* go through the bit lengths (k already is bits in shortest code) */ for (; k <= g; k++)
Signature · 1 line
Kees Cook @outflux.net
Quoted 1 line · Kees Cook
Eliminates compile-time warnings from "r" being uninitialized.
NAK. That sort of patches is only going to hide real problems in the code where such warnings are _not_ false positives.
Let me put it that way: what bug are you fixing in that patch? Is there a codepath that would lead to use of r without initialization? If there is - show it; if there is not - why are you patching kernel and not gcc?
Quoted 7 lines · Al Viro
NAK. That sort of patches is only going to hide real problems in the code where such warnings are _not_ false positives.
Let me put it that way: what bug are you fixing in that patch? Is there a codepath that would lead to use of r without initialization? If there is - show it; if there is not - why are you patching kernel and not gcc?
Well, good point. My only question would be: why are other "uninitialized" variables masked in the same way in that code?
Also, perhaps the phrasing in SubmittingPatches should be changed. Currently (for "trivial" patches) it says:
Warning fixes (cluttering with useless warnings is bad)
Is that warning considered "useful"? Should this hint, instead, read:
Warning fixes (make sure the warning is "real", if not, patch gcc)
:)
Signature · 1 line
Kees Cook @outflux.net