This patch fixes this Clang sometimes-uninitialized warning.

maxblocks.c:117:2: warning: variable 'shader' is used uninitialized whenever 
switch default is taken [-Wsometimes-uninitialized]
        default:
        ^~~~~~~
maxblocks.c:124:9: note: uninitialized use occurs here
        return shader;
               ^~~~~~
maxblocks.c:62:14: note: initialize the variable 'shader' to silence this 
warning
        char *shader;
                    ^
                     = NULL

Signed-off-by: Vinson Lee <[email protected]>
---
 tests/spec/arb_uniform_buffer_object/maxblocks.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/spec/arb_uniform_buffer_object/maxblocks.c 
b/tests/spec/arb_uniform_buffer_object/maxblocks.c
index f846894..dedce0e 100644
--- a/tests/spec/arb_uniform_buffer_object/maxblocks.c
+++ b/tests/spec/arb_uniform_buffer_object/maxblocks.c
@@ -59,7 +59,7 @@ PIGLIT_GL_TEST_CONFIG_END
 static char *
 get_shader(GLenum target, const char *block_prefix, int blocks)
 {
-       char *shader;
+       char *shader = NULL;
        const char *vs_source =
                "#extension GL_ARB_uniform_buffer_object : enable\n"
                "\n"
-- 
1.8.5.3

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to