Fixed Clang 5.0 compile errors (#4085)
* Fixed Clang 5.0 compile errors * Fixed wrong comment * Only disable warnings in Clang 5 or higher * Added a CMake condition for the Clang 5 no-zero-as-null-pointer-constant warning * Now using the use_nullptr branch of the Cuberite specific SQLiteCpp fork
This commit is contained in:
committed by
Alexander Harkness
parent
72616e7eb9
commit
532731e6f4
10
src/main.cpp
10
src/main.cpp
@@ -72,6 +72,12 @@ bool cRoot::m_RunAsService = false;
|
||||
|
||||
|
||||
#ifndef _DEBUG
|
||||
// Because SIG_DFL or SIG_IGN could be NULL instead of nullptr, we need to disable the Clang warning here
|
||||
#if __clang_major__ >= 5
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
|
||||
#endif
|
||||
|
||||
static void NonCtrlHandler(int a_Signal)
|
||||
{
|
||||
LOGD("Terminate event raised from std::signal");
|
||||
@@ -115,6 +121,10 @@ static void NonCtrlHandler(int a_Signal)
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
#if __clang_major__ >= 5
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user