From df125c39162e7e66267c0c9a3cb68a4eb6743064 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sun, 19 Jan 2025 15:22:17 +0100 Subject: [PATCH] Turn not returning from a function into an error!!!! --- src/CMakeLists.txt | 3 ++- src/r_data/gldefs.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a823e417d..72b3f70e6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -183,7 +183,8 @@ endif() # Set up flags for MSVC if (MSVC) - set( CMAKE_CXX_FLAGS "/MP ${CMAKE_CXX_FLAGS}" ) + # /we4715 turns "'function' : not all control paths return a value" as it should be!!!!!!!!one1! + set( CMAKE_CXX_FLAGS "/MP /we4715 ${CMAKE_CXX_FLAGS}" ) endif (MSVC) # Set up flags for GCC diff --git a/src/r_data/gldefs.cpp b/src/r_data/gldefs.cpp index c0c9b7d04..97f962174 100644 --- a/src/r_data/gldefs.cpp +++ b/src/r_data/gldefs.cpp @@ -137,6 +137,7 @@ const GlobalShaderDesc * GetGlobalShader(GlobalShaderAddr index) if(index.type == 1) return mapshaders[index.num].CheckKey(name); if(index.type == 2) return classshaders[index.num].CheckKey(name); + return &nullglobalshader; } void CleanupGlobalShaders()