Fix compilation with Clang 13.0.0
Clang 13 changes: * `-Wreserved-identifier` and `-Wunused-but-set-variable` got added * the `-Wreturn-std-move-in-c++11` option was removed Builds still fail when native optimizations are enabled
This commit is contained in:
parent
efeedcbd4d
commit
1a31098182
@ -158,7 +158,7 @@ function(set_exe_flags TARGET)
|
|||||||
# TODO: actually fix the warnings instead of disabling them
|
# TODO: actually fix the warnings instead of disabling them
|
||||||
# or at least disable on a file-level basis:
|
# or at least disable on a file-level basis:
|
||||||
-Wno-missing-noreturn -Wno-padded -Wno-implicit-fallthrough
|
-Wno-missing-noreturn -Wno-padded -Wno-implicit-fallthrough
|
||||||
-Wno-double-promotion
|
-Wno-double-promotion -Wno-reserved-identifier
|
||||||
|
|
||||||
# This is a pretty useless warning, we've already got -Wswitch which is what we need:
|
# This is a pretty useless warning, we've already got -Wswitch which is what we need:
|
||||||
-Wno-switch-enum
|
-Wno-switch-enum
|
||||||
@ -169,7 +169,7 @@ function(set_exe_flags TARGET)
|
|||||||
-Wno-documentation-unknown-command -Wno-reserved-id-macro -Wno-error=unused-command-line-argument
|
-Wno-documentation-unknown-command -Wno-reserved-id-macro -Wno-error=unused-command-line-argument
|
||||||
)
|
)
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13)
|
||||||
target_compile_options(
|
target_compile_options(
|
||||||
${TARGET} PRIVATE
|
${TARGET} PRIVATE
|
||||||
|
|
||||||
|
@ -117,8 +117,8 @@ bool cByteBuffer::Write(const void * a_Bytes, size_t a_Count)
|
|||||||
size_t CurFreeSpace = GetFreeSpace();
|
size_t CurFreeSpace = GetFreeSpace();
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
size_t CurReadableSpace = GetReadableSpace();
|
size_t CurReadableSpace = GetReadableSpace();
|
||||||
#endif
|
|
||||||
size_t WrittenBytes = 0;
|
size_t WrittenBytes = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (CurFreeSpace < a_Count)
|
if (CurFreeSpace < a_Count)
|
||||||
{
|
{
|
||||||
@ -135,7 +135,9 @@ bool cByteBuffer::Write(const void * a_Bytes, size_t a_Count)
|
|||||||
memcpy(m_Buffer + m_WritePos, Bytes, TillEnd);
|
memcpy(m_Buffer + m_WritePos, Bytes, TillEnd);
|
||||||
Bytes += TillEnd;
|
Bytes += TillEnd;
|
||||||
a_Count -= TillEnd;
|
a_Count -= TillEnd;
|
||||||
|
#ifndef NDEBUG
|
||||||
WrittenBytes = TillEnd;
|
WrittenBytes = TillEnd;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
m_WritePos = 0;
|
m_WritePos = 0;
|
||||||
}
|
}
|
||||||
@ -145,7 +147,9 @@ bool cByteBuffer::Write(const void * a_Bytes, size_t a_Count)
|
|||||||
{
|
{
|
||||||
memcpy(m_Buffer + m_WritePos, Bytes, a_Count);
|
memcpy(m_Buffer + m_WritePos, Bytes, a_Count);
|
||||||
m_WritePos += a_Count;
|
m_WritePos += a_Count;
|
||||||
|
#ifndef NDEBUG
|
||||||
WrittenBytes += a_Count;
|
WrittenBytes += a_Count;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT(GetFreeSpace() == CurFreeSpace - WrittenBytes);
|
ASSERT(GetFreeSpace() == CurFreeSpace - WrittenBytes);
|
||||||
|
@ -324,7 +324,6 @@ void cPawn::HandleFalling(void)
|
|||||||
|
|
||||||
/* We initialize these with what the foot is really IN, because for sampling we will move down with the epsilon above */
|
/* We initialize these with what the foot is really IN, because for sampling we will move down with the epsilon above */
|
||||||
bool IsFootInWater = IsBlockWater(BlockAtFoot);
|
bool IsFootInWater = IsBlockWater(BlockAtFoot);
|
||||||
bool IsFootInLiquid = IsFootInWater || IsBlockLava(BlockAtFoot) || (BlockAtFoot == E_BLOCK_COBWEB); // okay so cobweb is not _technically_ a liquid...
|
|
||||||
bool IsFootOnSlimeBlock = false;
|
bool IsFootOnSlimeBlock = false;
|
||||||
|
|
||||||
/* The "cross" we sample around to account for the player width/girth */
|
/* The "cross" we sample around to account for the player width/girth */
|
||||||
@ -377,7 +376,6 @@ void cPawn::HandleFalling(void)
|
|||||||
if (j == 0)
|
if (j == 0)
|
||||||
{
|
{
|
||||||
IsFootInWater |= IsBlockWater(BlockType);
|
IsFootInWater |= IsBlockWater(BlockType);
|
||||||
IsFootInLiquid |= IsFootInWater || IsBlockLava(BlockType) || (BlockType == E_BLOCK_COBWEB); // okay so cobweb is not _technically_ a liquid...
|
|
||||||
IsFootOnSlimeBlock |= (BlockType == E_BLOCK_SLIME_BLOCK);
|
IsFootOnSlimeBlock |= (BlockType == E_BLOCK_SLIME_BLOCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user