Browse Source

[chore] Resolve "warning C4127: conditional expression is constant" while building under MSVC (#3567)

NINJA REPORTS THIS SHIT ALMOST EVERY STEP!

[161/863] Building CXX object src\hid_core\CMakeFiles\hid_core.dir\frontend\input_interpreter.cpp.obj
D:\dev\eden\src\.\core/hle/kernel/k_auto_object.h(100): warning C4127: conditional expression is constant
D:\dev\eden\src\.\core/hle/kernel/k_auto_object.h(100): note: consider using 'if constexpr' statement instead
D:\dev\eden\src\.\core/hle/kernel/k_memory_manager.h(246): warning C4127: conditional expression is constant
D:\dev\eden\src\.\core/hle/kernel/k_memory_manager.h(246): note: consider using 'if constexpr' statement instead

The reason, any mention to UNIMPLEMENTED() macro reaches this point where a constant expression (macro argument) is not declared so.
There must be several other ways to suppress, like via cmake C4127 suppression or making every source constexpr, but lazy.
Since it's an unimplemented() feature assert call, i`ve just made it non constant. Covers everything. No charges.

Signed-off-by: xbzk <xbzk@eden-emu.dev>

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3567
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: DraVee <dravee@eden-emu.dev>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Co-authored-by: xbzk <xbzk@eden-emu.dev>
Co-committed-by: xbzk <xbzk@eden-emu.dev>
pull/3594/head
xbzk 3 days ago
committed by crueter
parent
commit
d19303883e
No known key found for this signature in database GPG Key ID: 425ACD2D4830EBC6
  1. 3
      src/common/assert.h

3
src/common/assert.h

@ -25,7 +25,8 @@ void AssertFailSoftImpl();
#define ASSERT_MSG(_a_, ...) \
([&]() YUZU_NO_INLINE { \
if (!(_a_)) [[unlikely]] { \
auto&& assert_condition = (_a_); \
if (!(assert_condition)) [[unlikely]] { \
LOG_CRITICAL(Debug, __FILE__ ": assert " __VA_ARGS__); \
AssertFailSoftImpl(); \
} \

Loading…
Cancel
Save