Enabled FatalWarnings. (#424)

This commit is contained in:
Branimir Karadžić
2026-09-03 04:20:46 +00:00
committed by GitHub
parent e21246d7ae
commit 975c8fb6fd
8 changed files with 21 additions and 3 deletions

View File

@@ -271,7 +271,7 @@ namespace bx
if (_from < mn)
{
return mn;
return Ty(mn);
}
else if (_from > mx)
{

View File

@@ -160,6 +160,9 @@ BX_FP_PRECISE_BEGIN()
BX_FP_PRECISE_END()
BX_PRAGMA_DIAGNOSTIC_PUSH();
BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4756); // warning C4756: overflow in constant arithmetic
inline BX_CONSTEXPR_FUNC simd32_t simd32_f32_madd(simd32_t _a, simd32_t _b, simd32_t _c)
{
const simd32_f32_ref_t a = bitCast<simd32_f32_ref_t>(_a);
@@ -185,6 +188,8 @@ BX_FP_PRECISE_END()
#endif // BX_CONFIG_FMA
}
BX_PRAGMA_DIAGNOSTIC_POP();
inline BX_CONSTEXPR_FUNC simd32_t simd32_f32_msub(simd32_t _a, simd32_t _b, simd32_t _c)
{
const simd32_t nc = simd32_f32_neg(_c);

View File

@@ -40,6 +40,10 @@ end
project "bx"
kind "StaticLib"
flags {
"FatalWarnings",
}
includedirs {
path.join(BX_DIR, "include"),
path.join(BX_DIR, "3rdparty"),

View File

@@ -46,7 +46,7 @@ project "bx.test"
debugdir (path.join(BX_DIR, "tests"))
flags {
-- "FatalWarnings",
"FatalWarnings",
}
removeflags {
@@ -114,6 +114,10 @@ project "bx.test"
project "bx.bench"
kind "ConsoleApp"
flags {
"FatalWarnings",
}
debugdir (path.join(BX_DIR, "tests"))
includedirs {

View File

@@ -159,6 +159,7 @@ namespace bx
{
Mutex::Mutex()
{
BX_UNUSED(m_internal);
}
Mutex::~Mutex()

View File

@@ -107,7 +107,7 @@ TEST_CASE("Saturate cast", "[cast]")
STATIC_REQUIRE(saturateCastTest<int64_t, uint16_t>( 0, 65535) );
STATIC_REQUIRE(saturateCastTest<int64_t, int32_t>( -2147483648, 2147483647) );
STATIC_REQUIRE(saturateCastTest<int64_t, uint32_t>( 0, 4294967295) );
STATIC_REQUIRE(saturateCastTest<int64_t, int64_t>( -9223372036854775808ll, 9223372036854775807ll) );
STATIC_REQUIRE(saturateCastTest<int64_t, int64_t>(-9223372036854775807ll-1, 9223372036854775807ll) );
STATIC_REQUIRE(saturateCastTest<int64_t, uint64_t>( 0, 9223372036854775807ll) );
STATIC_REQUIRE(saturateCastTest<uint64_t, int8_t>( 0, 127) );

View File

@@ -33,6 +33,7 @@ void testAssert()
{
BX_PRAGMA_DIAGNOSTIC_PUSH();
BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4804); // warning C4804: '%': unsafe use of type 'bool' in operation)
BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4127); // warning C4127: conditional expression is constant
BX_ASSERT(false % 1, "Assert works!");

View File

@@ -37,6 +37,9 @@
#include <bx/bx.h>
BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wexceptions"); // error: '~ErrorAssert' has a non-throwing exception specification but can still throw
BX_PRAGMA_DIAGNOSTIC_IGNORED_GCC("-Wterminate"); // error: 'throw' will always call 'terminate'
BX_PRAGMA_DIAGNOSTIC_PUSH();
BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4312); // warning C4312 : 'reinterpret_cast' : conversion from 'int' to 'const char *' of greater size
//BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wnan-infinity-disabled");