Skip to contentSkip to conversation

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

PATCH New [email protected] 1 participant 1 message Apr 11, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cogl: fix compile error caused by -Werror=maybe-uninitialized

From: Changqing Li <[email protected]>

When enable DEBUG_BUILD, cogl compile failed with error:

| ../../cogl-1.22.2/cogl/driver/gl/gles/cogl-driver-gles.c:217:17: error: 'gltype' may be used uninitialized in this function [-Werror=maybe-uninitialized]
|      *out_gltype = gltype;
|      ~~~~~~~~~~~~^~~~~~~~
| ../../cogl-1.22.2/cogl/driver/gl/gles/cogl-driver-gles.c:213:22: error: 'glintformat' may be used uninitialized in this function [-Werror=maybe-uninitialized]
|      *out_glintformat = glintformat;
|      ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~

Source: https://gitlab.gnome.org/GNOME/cogl/blob/master/cogl/driver/gl/gles/cogl-driver-gles.c
it can handle correctly, so fix with -Wnoerror

---
 meta/recipes-graphics/cogl/cogl-1.0.inc | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-graphics/cogl/cogl-1.0.inc +1 -0
index 7a79aa7..3e392fa 100644
@@ -31,6 +31,7 @@ EXTRA_OECONF += "--enable-examples-install	\
 	       	 --disable-gles1		\
 	         --disable-cairo                \
 	    	"
+DEBUG_OPTIMIZATION_append = " -Wno-error=maybe-uninitialized"
 
 # OpenGL/GLX
 PACKAGECONFIG[glx] = "--enable-gl --enable-glx,--disable-gl --disable-glx,${EDEPENDS_GL} ${EDEPENDS_X11},${ERDEPENDS_GL}"
Signature · 1 line
2.7.4