From 5dbda226593f1f8934c811963990083a23b220bf Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Thu, 24 Dec 2020 21:01:09 -0300 Subject: [PATCH 1/2] vk_shader_decompiler: Silence warning when compiling without asserts --- src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp index ca12b3793..72954d0e3 100644 --- a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp +++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp @@ -2094,6 +2094,7 @@ private: return OpFOrdGreaterThanEqual(t_bool, operand_1, operand_2); default: UNREACHABLE(); + return v_true; } } From 1e191cc837cf9ff38e5d5566919be54654d185b9 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Thu, 24 Dec 2020 21:01:23 -0300 Subject: [PATCH 2/2] video_core: Enforce C4715 (not all control paths return a value) Most of the time people write code that always returns a value, terminates execution, throws an exception, or uses an unconventional jump primitive. This is not always true when we build without asserts on mainline builds. To avoid introducing undefined behavior on our most used builds, enforce this warning signalling an error and stopping the build from shipping. --- src/video_core/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index a021d61f5..90f533730 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt @@ -303,6 +303,7 @@ if (MSVC) /we4457 # Declaration of 'identifier' hides function parameter /we4458 # Declaration of 'identifier' hides class member /we4459 # Declaration of 'identifier' hides global declaration + /we4715 # 'function' : not all control paths return a value ) else() target_compile_options(video_core PRIVATE