[Piglit] [PATCH] cl-program-tester: Add NORETURN attribute to exit_report_result.

Vinson Lee vlee at freedesktop.org
Mon Sep 1 21:03:51 PDT 2014


Fix clang sometimes-uninitialized warning.

program-tester.c:1523:12: warning: variable 'main_argument_type' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
        } else if(regex_match(main_argument, "\\.bin$")) {
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
program-tester.c:1542:9: note: uninitialized use occurs here
        switch(main_argument_type) {
               ^~~~~~~~~~~~~~~~~~
program-tester.c:1523:9: note: remove the 'if' if its condition is always true
        } else if(regex_match(main_argument, "\\.bin$")) {
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
program-tester.c:1455:2: note: variable 'main_argument_type' is declared here
        enum main_argument_type_t {
        ^

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/cl/program/program-tester.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/cl/program/program-tester.c b/tests/cl/program/program-tester.c
index a51f148..38a9379 100644
--- a/tests/cl/program/program-tester.c
+++ b/tests/cl/program/program-tester.c
@@ -451,7 +451,7 @@ clean(const int argc,
 	free_tests();
 }
 
-void
+NORETURN void
 exit_report_result(enum piglit_result result)
 {
 	free_dynamic_strs();
-- 
1.9.1



More information about the Piglit mailing list