On 10/27/2014 11:03 PM, Vinson Lee wrote:
Silence clang sometimes-uninitialized warnings.

simple.c:368:6: warning: variable 'test_type' is used uninitialized whenever 
'if' condition is false [-Wsometimes-uninitialized]
         if (all_types[i])
             ^~~~~~~~~~~~
simple.c:380:30: note: uninitialized use occurs here
         piglit_require_GLSL_version(test_type->glsl_version_required);
                                     ^~~~~~~~~
simple.c:368:2: note: remove the 'if' if its condition is always true
         if (all_types[i])
         ^~~~~~~~~~~~~~~~~
simple.c:355:35: note: initialize the variable 'test_type' to silence this 
warning
         const struct type_desc *test_type;
                                          ^
                                           = NULL
simple.c:374:11: warning: variable 'test_array' is used uninitialized whenever 
'if' condition is false [-Wsometimes-uninitialized]
         else if (strcmp(argv[2], "separate") == 0)
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
simple.c:385:12: note: uninitialized use occurs here
                                        test_array, max_varying_floats);
                                        ^~~~~~~~~~
simple.c:374:7: note: remove the 'if' if its condition is always true
         else if (strcmp(argv[2], "separate") == 0)
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
simple.c:356:22: note: initialize the variable 'test_array' to silence this 
warning
         GLboolean test_array;
                             ^
                              = '\0'

Signed-off-by: Vinson Lee <[email protected]>
---
  tests/spec/glsl-1.10/execution/varying-packing/simple.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/spec/glsl-1.10/execution/varying-packing/simple.c 
b/tests/spec/glsl-1.10/execution/varying-packing/simple.c
index 87ff37e..6d07a36 100644
--- a/tests/spec/glsl-1.10/execution/varying-packing/simple.c
+++ b/tests/spec/glsl-1.10/execution/varying-packing/simple.c
@@ -335,7 +335,7 @@ choose_varyings(struct varying_desc *varyings,
  }

  void
-print_usage_and_exit(const char *prog_name)
+NORETURN print_usage_and_exit(const char *prog_name)
  {
        unsigned i;
        printf("Usage: %s <type> <arrayspec>\n"


Reviewed-by: Brian Paul <[email protected]>

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

Reply via email to