mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-06 10:53:50 +08:00
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:
committed by
Joost VandeVondele
parent
4f021cab3b
commit
c13c1d2c30
@@ -33,12 +33,16 @@
|
|||||||
namespace Stockfish::Eval::NNUE {
|
namespace Stockfish::Eval::NNUE {
|
||||||
|
|
||||||
#if defined(__GNUC__) && !defined(__clang__)
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
#define sf_assume(cond) \
|
#if __GNUC__ >= 13
|
||||||
do \
|
#define sf_assume(cond) __attribute__((assume(cond)))
|
||||||
{ \
|
#else
|
||||||
if (!(cond)) \
|
#define sf_assume(cond) \
|
||||||
__builtin_unreachable(); \
|
do \
|
||||||
} while (0)
|
{ \
|
||||||
|
if (!(cond)) \
|
||||||
|
__builtin_unreachable(); \
|
||||||
|
} while (0)
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
// do nothing for other compilers
|
// do nothing for other compilers
|
||||||
#define sf_assume(cond)
|
#define sf_assume(cond)
|
||||||
|
|||||||
Reference in New Issue
Block a user