Silence "may be used uninitialized" GCC 15 warning

closes https://github.com/official-stockfish/Stockfish/pull/6083

No functional change
This commit is contained in:
Disservin
2025-05-22 18:41:53 +02:00
committed by Joost VandeVondele
parent 4f021cab3b
commit c13c1d2c30

View File

@@ -33,12 +33,16 @@
namespace Stockfish::Eval::NNUE {
#if defined(__GNUC__) && !defined(__clang__)
#if __GNUC__ >= 13
#define sf_assume(cond) __attribute__((assume(cond)))
#else
#define sf_assume(cond) \
do \
{ \
if (!(cond)) \
__builtin_unreachable(); \
} while (0)
#endif
#else
// do nothing for other compilers
#define sf_assume(cond)