gd: fix compile error caused by -Werror=maybe-uninitialized

When enable DEBUG_BUILD, gd compile failed with error:

| ../../git/src/gd_tiff.c:961:64: error: 'image_type' may be used uninitialized in this function [-Werror=maybe-uninitialized]
|           (image_type == GD_PALETTE || image_type == GD_INDEXED || image_type == GD_GRAY)) {
|           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~

actually, this warning is misinformation, we can see the logic from:
https://github.com/libgd/libgd/blob/master/src/gd_tiff.c
image_type will be assigned no matter force_rgba is TRUE/FALSE.

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Changqing Li 2019-04-08 13:43:46 +08:00 committed by Khem Raj
parent 71117c3cf2
commit 8099332416

View File

@ -35,6 +35,8 @@ EXTRA_OECONF += " --disable-rpath \
EXTRA_OEMAKE = 'LDFLAGS="${LDFLAGS}"'
DEBUG_OPTIMIZATION_append = " -Wno-error=maybe-uninitialized"
do_install_append() {
# cleanup buildpaths from gdlib.pc
sed -i -e 's#${STAGING_DIR_HOST}##g' ${D}${libdir}/pkgconfig/gdlib.pc