All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cogl: fix compile error with -Werror=maybe-uninitialized
@ 2019-04-02  9:08 changqing.li
  2019-04-02 11:31 ` Adrian Bunk
  2019-04-04 13:42 ` Burton, Ross
  0 siblings, 2 replies; 10+ messages in thread
From: changqing.li @ 2019-04-02  9:08 UTC (permalink / raw)
  To: openembedded-core

From: Changqing Li <changqing.li@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@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@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@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



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] cogl: fix compile error with -Werror=maybe-uninitialized
  2019-04-02  9:08 [PATCH] cogl: fix compile error with -Werror=maybe-uninitialized changqing.li
@ 2019-04-02 11:31 ` Adrian Bunk
  2019-04-03  2:29   ` Changqing Li
  2019-04-04 13:42 ` Burton, Ross
  1 sibling, 1 reply; 10+ messages in thread
From: Adrian Bunk @ 2019-04-02 11:31 UTC (permalink / raw)
  To: changqing.li; +Cc: openembedded-core

On Tue, Apr 02, 2019 at 05:08:33PM +0800, changqing.li@windriver.com wrote:
> From: Changqing Li <changqing.li@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;
> |      ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
>...

Looking at the code, is this a failure that only happens with DEBUG_FLAGS?
 
> +--- 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;
>...

Assigning random values to variables is a bug,
they do not even seem to be valid values for these variables.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] cogl: fix compile error with -Werror=maybe-uninitialized
  2019-04-02 11:31 ` Adrian Bunk
@ 2019-04-03  2:29   ` Changqing Li
  2019-04-03  9:58     ` Adrian Bunk
  0 siblings, 1 reply; 10+ messages in thread
From: Changqing Li @ 2019-04-03  2:29 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: openembedded-core


On 4/2/19 7:31 PM, Adrian Bunk wrote:
> On Tue, Apr 02, 2019 at 05:08:33PM +0800, changqing.li@windriver.com wrote:
>> From: Changqing Li <changqing.li@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;
>> |      ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
>> ...
> Looking at the code, is this a failure that only happens with DEBUG_FLAGS?
Yes, only happen with DEBUG_FLAGS
>   
>> +--- 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;
>> ...
> Assigning random values to variables is a bug,
> they do not even seem to be valid values for these variables.

According to code logic,  glformat and glintformat will assigned 
simultaneously and usually with same value,

and 0 mean invalid pixel format.

[snip]

     case COGL_PIXEL_FORMAT_DEPTH_24_STENCIL_8:
       glintformat = GL_DEPTH_STENCIL;
       glformat = GL_DEPTH_STENCIL;
       gltype = GL_UNSIGNED_INT_24_8;
       break;

and for gtype, there also should be no problem according to the code logic.

and the fix is just for eliminate the error when DEBUG_FLAGS is enabled.

>
> cu
> Adrian
>
-- 
BRs

Sandy(Li Changqing)



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] cogl: fix compile error with -Werror=maybe-uninitialized
  2019-04-03  2:29   ` Changqing Li
@ 2019-04-03  9:58     ` Adrian Bunk
  2019-04-04  2:06       ` Changqing Li
  0 siblings, 1 reply; 10+ messages in thread
From: Adrian Bunk @ 2019-04-03  9:58 UTC (permalink / raw)
  To: Changqing Li; +Cc: openembedded-core

On Wed, Apr 03, 2019 at 10:29:08AM +0800, Changqing Li wrote:
> 
> On 4/2/19 7:31 PM, Adrian Bunk wrote:
> > On Tue, Apr 02, 2019 at 05:08:33PM +0800, changqing.li@windriver.com wrote:
> > > From: Changqing Li <changqing.li@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;
> > > |      ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
> > > ...
> > Looking at the code, is this a failure that only happens with DEBUG_FLAGS?
> Yes, only happen with DEBUG_FLAGS
> > > +--- 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;
> > > ...
> > Assigning random values to variables is a bug,
> > they do not even seem to be valid values for these variables.
> 
> According to code logic,  glformat and glintformat will assigned
> simultaneously and usually with same value,

But glformat has an assert later to ensure the 0 doesn't leak anywhere.

> and 0 mean invalid pixel format.

For pixel format 0 means COGL_PIXEL_FORMAT_ANY.

For glintformat I don't know what would happen if 0 is used.

> [snip]
> 
>     case COGL_PIXEL_FORMAT_DEPTH_24_STENCIL_8:
>       glintformat = GL_DEPTH_STENCIL;
>       glformat = GL_DEPTH_STENCIL;
>       gltype = GL_UNSIGNED_INT_24_8;
>       break;
> 
> and for gtype, there also should be no problem according to the code logic.

According to the current code.

If some future change breaks the code, it would pass invalid data at 
runtime instead of giving a compile warning.

> and the fix is just for eliminate the error when DEBUG_FLAGS is enabled.

Looking at the code, does passing --enable-maintainer-flags=no
to configure work around this gcc bug?

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] cogl: fix compile error with -Werror=maybe-uninitialized
  2019-04-03  9:58     ` Adrian Bunk
@ 2019-04-04  2:06       ` Changqing Li
  2019-04-04  8:11         ` Adrian Bunk
  0 siblings, 1 reply; 10+ messages in thread
From: Changqing Li @ 2019-04-04  2:06 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: openembedded-core


On 4/3/19 5:58 PM, Adrian Bunk wrote:
> On Wed, Apr 03, 2019 at 10:29:08AM +0800, Changqing Li wrote:
>> On 4/2/19 7:31 PM, Adrian Bunk wrote:
>>> On Tue, Apr 02, 2019 at 05:08:33PM +0800, changqing.li@windriver.com wrote:
>>>> From: Changqing Li <changqing.li@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;
>>>> |      ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
>>>> ...
>>> Looking at the code, is this a failure that only happens with DEBUG_FLAGS?
>> Yes, only happen with DEBUG_FLAGS
>>>> +--- 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;
>>>> ...
>>> Assigning random values to variables is a bug,
>>> they do not even seem to be valid values for these variables.
>> According to code logic,  glformat and glintformat will assigned
>> simultaneously and usually with same value,
> But glformat has an assert later to ensure the 0 doesn't leak anywhere.
>
>> and 0 mean invalid pixel format.
> For pixel format 0 means COGL_PIXEL_FORMAT_ANY.
>
> For glintformat I don't know what would happen if 0 is used.
>
>> [snip]
>>
>>      case COGL_PIXEL_FORMAT_DEPTH_24_STENCIL_8:
>>        glintformat = GL_DEPTH_STENCIL;
>>        glformat = GL_DEPTH_STENCIL;
>>        gltype = GL_UNSIGNED_INT_24_8;
>>        break;
>>
>> and for gtype, there also should be no problem according to the code logic.
> According to the current code.
>
> If some future change breaks the code, it would pass invalid data at
> runtime instead of giving a compile warning.
>
>> and the fix is just for eliminate the error when DEBUG_FLAGS is enabled.
> Looking at the code, does passing --enable-maintainer-flags=no
> to configure work around this gcc bug

Hi, Adrian

Thanks for your detailed comments. And the future change wrong is 
reasonable, but according to

current code,  seems it can assert from g_assert_not_reached or g_assert 
when glformat/glintformat is not assigned new value.

[snip]

     case xxx

            glformat=xxx

            glintformat=xxx

     case COGL_PIXEL_FORMAT_ANY:
     case COGL_PIXEL_FORMAT_YUV:
       g_assert_not_reached ();
       break;
     }

   /* All of the pixel formats are handled above so if this hits then
      we've been given an invalid pixel format */
   g_assert (glformat != 0);


And also upstream have use same way to fix under 
cogl/driver/gl/gl/cogl-driver-gl.c

https://gitlab.gnome.org/GNOME/cogl/commit/ca5226513eb64bceb38ca01994799c4e7cd9f5fa

so I think we can fix same way under this 
cogl/driver/gl/gles/cogl-driver-gles.c

>
> cu
> Adrian
>
-- 
BRs

Sandy(Li Changqing)



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] cogl: fix compile error with -Werror=maybe-uninitialized
  2019-04-04  2:06       ` Changqing Li
@ 2019-04-04  8:11         ` Adrian Bunk
  2019-04-08  2:12           ` Changqing Li
  0 siblings, 1 reply; 10+ messages in thread
From: Adrian Bunk @ 2019-04-04  8:11 UTC (permalink / raw)
  To: Changqing Li; +Cc: openembedded-core

On Thu, Apr 04, 2019 at 10:06:44AM +0800, Changqing Li wrote:
>...
> And also upstream have use same way to fix under
> cogl/driver/gl/gl/cogl-driver-gl.c
> 
> https://gitlab.gnome.org/GNOME/cogl/commit/ca5226513eb64bceb38ca01994799c4e7cd9f5fa

Have they?

This looks like a 4 year old commit that was never merged.

> so I think we can fix same way under this
> cogl/driver/gl/gles/cogl-driver-gles.c

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] cogl: fix compile error with -Werror=maybe-uninitialized
  2019-04-02  9:08 [PATCH] cogl: fix compile error with -Werror=maybe-uninitialized changqing.li
  2019-04-02 11:31 ` Adrian Bunk
@ 2019-04-04 13:42 ` Burton, Ross
  2019-04-08  2:14   ` Changqing Li
  2019-04-08  6:01   ` [PATCH V2] " changqing.li
  1 sibling, 2 replies; 10+ messages in thread
From: Burton, Ross @ 2019-04-04 13:42 UTC (permalink / raw)
  To: Changqing Li; +Cc: OE-core

+Upstream-Status: Submitted
[https://github.com/GNOME/cogl/pull/4/commits/be7a7b983952d3f2ce2cbaa7b89f413b92e15066]

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@windriver.com> wrote:
>
> From: Changqing Li <changqing.li@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@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@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@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@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] cogl: fix compile error with -Werror=maybe-uninitialized
  2019-04-04  8:11         ` Adrian Bunk
@ 2019-04-08  2:12           ` Changqing Li
  0 siblings, 0 replies; 10+ messages in thread
From: Changqing Li @ 2019-04-08  2:12 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: openembedded-core


On 4/4/19 4:11 PM, Adrian Bunk wrote:
> On Thu, Apr 04, 2019 at 10:06:44AM +0800, Changqing Li wrote:
>> ...
>> And also upstream have use same way to fix under
>> cogl/driver/gl/gl/cogl-driver-gl.c
>>
>> https://gitlab.gnome.org/GNOME/cogl/commit/ca5226513eb64bceb38ca01994799c4e7cd9f5fa
> Have they?
>
> This looks like a 4 year old commit that was never merged.

Seems it merged to 1.22 branch,  I can see it switch to tag 1.22.2, but 
indeed,  it  not merge to master.

and this change also include in 
http://ftp.gnome.org/pub/GNOME/sources/cogl/1.22/cogl-1.22.2.tar.xz.

>
>> so I think we can fix same way under this
>> cogl/driver/gl/gles/cogl-driver-gles.c
> cu
> Adrian
>
-- 
BRs

Sandy(Li Changqing)



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] cogl: fix compile error with -Werror=maybe-uninitialized
  2019-04-04 13:42 ` Burton, Ross
@ 2019-04-08  2:14   ` Changqing Li
  2019-04-08  6:01   ` [PATCH V2] " changqing.li
  1 sibling, 0 replies; 10+ messages in thread
From: Changqing Li @ 2019-04-08  2:14 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core


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@windriver.com> wrote:
>> From: Changqing Li <changqing.li@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@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@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@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@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core

-- 
BRs

Sandy(Li Changqing)



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH V2] cogl: fix compile error with -Werror=maybe-uninitialized
  2019-04-04 13:42 ` Burton, Ross
  2019-04-08  2:14   ` Changqing Li
@ 2019-04-08  6:01   ` changqing.li
  1 sibling, 0 replies; 10+ messages in thread
From: changqing.li @ 2019-04-08  6:01 UTC (permalink / raw)
  To: openembedded-core

From: Changqing Li <changqing.li@windriver.com>

fix below compile error with -Werror=maybe-uninitialized
while DEBUG_BUILD is enabled

| ../../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@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..1cfd35c
--- /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@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 when DEBUG_BUILD is enabled
+
+| ../../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://gitlab.gnome.org/GNOME/cogl/issues/6]
+
+Signed-off-by: Changqing Li <changqing.li@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



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-04-08  6:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-02  9:08 [PATCH] cogl: fix compile error with -Werror=maybe-uninitialized changqing.li
2019-04-02 11:31 ` Adrian Bunk
2019-04-03  2:29   ` Changqing Li
2019-04-03  9:58     ` Adrian Bunk
2019-04-04  2:06       ` Changqing Li
2019-04-04  8:11         ` Adrian Bunk
2019-04-08  2:12           ` Changqing Li
2019-04-04 13:42 ` Burton, Ross
2019-04-08  2:14   ` Changqing Li
2019-04-08  6:01   ` [PATCH V2] " changqing.li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.