It's surprising gcc doesn't realize this gs is always initlaized where it 
matters.

Anyway, patch looks good.

Jose

________________________________________
From: Piglit <[email protected]> on behalf of Vinson Lee 
<[email protected]>
Sent: 14 November 2014 19:59
To: [email protected]
Subject: [Piglit] [PATCH] ext_transform_feedback: Silence GCC   
-Wmaybe-uninitialized warning.

Fixes this GCC maybe-uninitialized warning.

intervening-read.c: In function 'piglit_init':
intervening-read.c:225:17: warning: 'gs' may be used uninitialized in this 
function [-Wmaybe-uninitialized]
   glAttachShader(prog, gs);
                 ^

Signed-off-by: Vinson Lee <[email protected]>
---
 tests/spec/ext_transform_feedback/intervening-read.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/spec/ext_transform_feedback/intervening-read.c 
b/tests/spec/ext_transform_feedback/intervening-read.c
index 1396182..8c4896c 100644
--- a/tests/spec/ext_transform_feedback/intervening-read.c
+++ b/tests/spec/ext_transform_feedback/intervening-read.c
@@ -216,6 +216,7 @@ piglit_init(int argc, char **argv)
                fs = piglit_compile_shader_text(GL_FRAGMENT_SHADER, fstext_gs);
        } else {
                vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vstext_nogs);
+               gs = 0;
                fs = piglit_compile_shader_text(GL_FRAGMENT_SHADER,
                                                fstext_nogs);
        }
--
1.9.3

_______________________________________________
Piglit mailing list
[email protected]
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.freedesktop.org_mailman_listinfo_piglit&d=AAIGaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=zfmBZnnVGHeYde45pMKNnVyzeaZbdIqVLprmZCM2zzE&m=t3XtOpwH4OMJJ3RuAmEFrsITUhPH6FZ5Vldl2eF7X8U&s=zE3vegpwSFmt7bcAj4Ghf-il1g83WyZToK2Z688oAxo&e=
_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to