[cogl/wip/smcv/uninitialized: 2/2] tests: Reassure compiler that uninitialized variables are not reached



commit fc8b269e33ba179a55a79bf50cec62286ac50bc6
Author: Simon McVittie <smcv debian org>
Date:   Tue Mar 10 11:31:43 2020 +0000

    tests: Reassure compiler that uninitialized variables are not reached
    
    gcc 9 detects that if we exit this switch due to an unsupported
    cull mode, the variables that it sets will remain uninitialized,
    causing compilation with -Werror=uninitialized to fail.
    
    Signed-off-by: Simon McVittie <smcv debian org>

 tests/conform/test-backface-culling.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/tests/conform/test-backface-culling.c b/tests/conform/test-backface-culling.c
index e90c2f5e..c06ec79a 100644
--- a/tests/conform/test-backface-culling.c
+++ b/tests/conform/test-backface-culling.c
@@ -193,6 +193,9 @@ validate_result (CoglFramebuffer *framebuffer, int y_offset)
           cull_front = TRUE;
           cull_back = TRUE;
           break;
+
+        default:
+          g_assert_not_reached ();
         }
 
       if (FRONT_WINDING (draw_num) == COGL_WINDING_CLOCKWISE)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]