[Mesa-dev] [PATCH v2] mesa/main: Fix missing return in non void function

Tobias Klausmann tobias.johannes.klausmann at mni.thm.de
Thu Aug 25 21:48:31 UTC 2016


This was found by obs:
I: Program returns random data in a function
E: Mesa no-return-in-nonvoid-function main/program_resource.c:109

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann at mni.thm.de>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
---
V2: 
Remove the !, cosmetic change, as the macro expansion stringifies everything:
__assert_fail ("!!\"unexpected programInterface value\"", ...) -> 
__assert_fail ("!\"unexpected programInterface value\"", ...)


Somebody else hast to push this! (I'dont have access to the fdo repos)


 src/mesa/main/program_resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/program_resource.c b/src/mesa/main/program_resource.c
index 6ddbdad..5726ce1 100644
--- a/src/mesa/main/program_resource.c
+++ b/src/mesa/main/program_resource.c
@@ -104,7 +104,7 @@ stage_from_program_interface(GLenum programInterface)
    case GL_COMPUTE_SUBROUTINE_UNIFORM:
       return MESA_SHADER_COMPUTE;
    default:
-      assert(!"unexpected programInterface value");
+      unreachable("unexpected programInterface value");
    }
 }
 
-- 
2.9.3



More information about the mesa-dev mailing list