[Piglit] [PATCH] ext_transform_feedback: Silence GCC -Wmaybe-uninitialized warning.

Jose Fonseca jfonseca at vmware.com
Fri Nov 14 12:16:23 PST 2014


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

Anyway, patch looks good.

Jose

________________________________________
From: Piglit <piglit-bounces at lists.freedesktop.org> on behalf of Vinson Lee <vlee at freedesktop.org>
Sent: 14 November 2014 19:59
To: piglit at lists.freedesktop.org
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 <vlee at freedesktop.org>
---
 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
Piglit at lists.freedesktop.org
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=


More information about the Piglit mailing list