[OE-core] [PATCH] cogl: fix compile error with -Werror=maybe-uninitialized

Changqing Li changqing.li at windriver.com
Mon Apr 8 02:14:06 UTC 2019


On 4/4/19 9:42 PM, Burton, Ross wrote:
> +Upstream-Status: Submitted
> [https://github.com/GNOME/cogl/pull/4/commits/be7a7b983952d3f2ce2cbaa7b89f413b92e15066]
The pull request has automatically  forwarded to GNOME gitlab,  I will 
send a V2 to fix this.
>
> That's a GNOME mirror, note how your PR was closed.  GNOME is at
> gitlab.gnome.org.
>
> Ross
>
> On Tue, 2 Apr 2019 at 10:37, <changqing.li at windriver.com> wrote:
>> From: Changqing Li <changqing.li at windriver.com>
>>
>> fix below compile error with -Werror=maybe-uninitialized
>>
>> | ../../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;
>> |      ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
>>
>> Signed-off-by: Changqing Li <changqing.li at windriver.com>
>> ---
>>   ...mpile-error-with-Werror-maybe-uninitializ.patch | 40 ++++++++++++++++++++++
>>   meta/recipes-graphics/cogl/cogl-1.0_1.22.2.bb      |  4 ++-
>>   2 files changed, 43 insertions(+), 1 deletion(-)
>>   create mode 100644 meta/recipes-graphics/cogl/cogl-1.0/0001-cogl-fix-compile-error-with-Werror-maybe-uninitializ.patch
>>
>> diff --git a/meta/recipes-graphics/cogl/cogl-1.0/0001-cogl-fix-compile-error-with-Werror-maybe-uninitializ.patch b/meta/recipes-graphics/cogl/cogl-1.0/0001-cogl-fix-compile-error-with-Werror-maybe-uninitializ.patch
>> new file mode 100644
>> index 0000000..3c99d25
>> --- /dev/null
>> +++ b/meta/recipes-graphics/cogl/cogl-1.0/0001-cogl-fix-compile-error-with-Werror-maybe-uninitializ.patch
>> @@ -0,0 +1,40 @@
>> +From e05ee89fcc978fceccab3e4724a3a37f7a338499 Mon Sep 17 00:00:00 2001
>> +From: Changqing Li <changqing.li at windriver.com>
>> +Date: Tue, 2 Apr 2019 14:48:49 +0800
>> +Subject: [PATCH] cogl: fix compile error with -Werror=maybe-uninitialized
>> +
>> +fix below compile error with -Werror=maybe-uninitialized
>> +
>> +| ../../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;
>> +|      ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
>> +
>> +Upstream-Status: Submitted [https://github.com/GNOME/cogl/pull/4/commits/be7a7b983952d3f2ce2cbaa7b89f413b92e15066]
>> +
>> +Signed-off-by: Changqing Li <changqing.li at windriver.com>
>> +---
>> + cogl/driver/gl/gles/cogl-driver-gles.c | 4 ++--
>> + 1 file changed, 2 insertions(+), 2 deletions(-)
>> +
>> +diff --git a/cogl/driver/gl/gles/cogl-driver-gles.c b/cogl/driver/gl/gles/cogl-driver-gles.c
>> +index e94449f..a59d815 100644
>> +--- a/cogl/driver/gl/gles/cogl-driver-gles.c
>> ++++ b/cogl/driver/gl/gles/cogl-driver-gles.c
>> +@@ -74,9 +74,9 @@ _cogl_driver_pixel_format_to_gl (CoglContext *context,
>> +                                  GLenum *out_gltype)
>> + {
>> +   CoglPixelFormat required_format;
>> +-  GLenum glintformat;
>> ++  GLenum glintformat = 0;
>> +   GLenum glformat = 0;
>> +-  GLenum gltype;
>> ++  GLenum gltype = 0;
>> +
>> +   required_format = format;
>> +
>> +--
>> +2.7.4
>> +
>> diff --git a/meta/recipes-graphics/cogl/cogl-1.0_1.22.2.bb b/meta/recipes-graphics/cogl/cogl-1.0_1.22.2.bb
>> index 5901062..5ddeb4a 100644
>> --- a/meta/recipes-graphics/cogl/cogl-1.0_1.22.2.bb
>> +++ b/meta/recipes-graphics/cogl/cogl-1.0_1.22.2.bb
>> @@ -1,7 +1,9 @@
>>   require cogl-1.0.inc
>>
>>   SRC_URI += "file://test-backface-culling.c-fix-may-be-used-uninitialize.patch \
>> -            file://0001-Fix-an-incorrect-preprocessor-conditional.patch"
>> +            file://0001-Fix-an-incorrect-preprocessor-conditional.patch \
>> +            file://0001-cogl-fix-compile-error-with-Werror-maybe-uninitializ.patch \
>> +           "
>>   SRC_URI[archive.md5sum] = "d53b708ca7c4af03d7254e46945d6b33"
>>   SRC_URI[archive.sha256sum] = "39a718cdb64ea45225a7e94f88dddec1869ab37a21b339ad058a9d898782c00d"
>>
>> --
>> 2.7.4
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core at lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core

-- 
BRs

Sandy(Li Changqing)



More information about the Openembedded-core mailing list