Release Build Warnings
Article text.
--
Julian Smith - 2020-03-03
Possible fixes for release build warnings:
./openjpeg/src/lib/openjp2/dwt.c:596:5: warning: "__AVX2__" is not defined, evaluates to 0 [-Wundef]
s/#if __AVX2__/#ifdef __AVX2__
./openjpeg/src/lib/openjp2/j2k.c:6450:12: warning: function declaration isnât a prototype [-Wstrict-prototypes]
s/static int opj_j2k_get_default_thread_count()/static int opj_j2k_get_default_thread_count(void)
./tiff//libtiff/tif_open.c:104:5: warning: variable ânâ set but not used [-Wunused-but-set-variable]
put inside #ifndef NDEBUG
./freetype/src/autofit/afcjk.c:780:3: warning: no previous prototype for âaf_cjk_get_standard_widthsâ [-Wmissing-prototypes]
./freetype/src/autofit/aflatin.c:1514:3: warning: no previous prototype for âaf_latin_get_standard_widthsâ [-Wmissing-prototypes]
s/FT_LOCAL_DEF( void )/static void
./base/gsicc_cache.c:1526:17: warning: âpnameâ may be used uninitialized in this function [-Wmaybe-uninitialized]
it's safe, but could explicitly set pname=NULL.
./devices/vector/gdevpdfr.c:328:32: warning: array subscript -1 is below array bounds of âbyte[50]â {aka âunsigned char[50]â} [-Warray-bounds]
./base/spsdf.c:102:32: warning: array subscript -1 is below array bounds of âbyte[100]â {aka âunsigned char[100]â} [-Warray-bounds]
./base/stream.c:162:65: warning: array subscript -1 is below array bounds of âbyte[50]â {aka âunsigned char[50]â} [-Warray-bounds]
s/w.ptr = buf; w.ptr--;/w.ptr = buf;/
s/r.limit = end - 1;/r.limit = end/
and in s_PSSD_process() do: s/*++q = c;/*q++ = c;
./cups/gdevcups.c:3121:25: warning: variable âname_requested_matchedâ set but not used [-Wunused-but-set-variable]
#ifdef CUPS_DEBUG
+ #else
+ (void) name_requested_matched;
+ #endif
./base/gdevmrun.c:554:31: warning: ârpnâ may be used uninitialized in this function [-Wmaybe-uninitialized]
?
./base/gxclbits.c:119:32: warning: array subscript -1 is below array bounds of âbyte[256]â {aka âunsigned char[256]â} [-Warray-bounds]
./base/gxclbits.c:136:32: warning: array subscript -1 is below array bounds of âbyte[256]â {aka âunsigned char[256]â} [-Warray-bounds]
s/r2.ptr = zeros - 1;/r2.ptr = zeros
s/r2.limit = r2.ptr + padding;/r2.limit = r2.ptr + padding + 1; ???
in go_process(): no change?
./psi/iutil.c:407:41: warning: array subscript -1 is below array bounds of âchar[256]â [-Warray-bounds]
./psi/iutil.c:410:52: warning: array subscript -1 is below array bounds of âchar[256]â [-Warray-bounds]
w.ptr = (byte *)buf - 1;
w.limit = w.ptr + min(skip + len1, sizeof(buf));
is this ok? if we are comparing .ptr with .limit, then maybe need to use sizeof(buf)+1.
./obj/jcsample.c:483:11: warning: variable âsmoothokâ set but not used [-Wunused-but-set-variable]
jpeg/jcsample.c
#ifdef INPUT_SMOOTHING_SUPPORTED
if (cinfo->smoothing_factor && !smoothok)
TRACEMS(cinfo, 0, JTRC_SMOOTH_NOTIMPL);
+ #else
+ (void) smoothok;
#endif
./devices/gdevpdfimg.c:633:32: warning: array subscript -1 is below array bounds of âbyte[100]â {aka âunsigned char[100]â} [-Warray-bounds]
s/w.ptr = buf; w.ptr--;/w.ptr = buf;
existing code does 'r.limit = r.ptr + size;' which is incompatible with w.ptr = buf; w.ptr--;.
Comments