mirror of https://github.com/SChernykh/p2pool
Enabled more compiler warnings
parent
9a5be0a321
commit
6ef34bb3f5
|
@ -7,7 +7,7 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
||||||
set(GENERAL_FLAGS "-pthread")
|
set(GENERAL_FLAGS "-pthread")
|
||||||
set(WARNING_FLAGS "-Wall -Wextra -Werror")
|
set(WARNING_FLAGS "-Wall -Wextra -Wcast-align -Wcast-qual -Wlogical-op -Wstrict-overflow=2 -Wundef -Wformat=2 -Wpointer-arith -Werror")
|
||||||
set(OPTIMIZATION_FLAGS "-Ofast -s")
|
set(OPTIMIZATION_FLAGS "-Ofast -s")
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GENERAL_FLAGS} ${WARNING_FLAGS} ${OPTIMIZATION_FLAGS}")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GENERAL_FLAGS} ${WARNING_FLAGS} ${OPTIMIZATION_FLAGS}")
|
||||||
|
@ -42,7 +42,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||||
|
|
||||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
||||||
set(GENERAL_FLAGS "-pthread")
|
set(GENERAL_FLAGS "-pthread")
|
||||||
set(WARNING_FLAGS "-Wall -Wextra -Wno-undefined-internal -Werror")
|
set(WARNING_FLAGS "-Wall -Wextra -Wno-undefined-internal -Wunreachable-code-aggressive -Wmissing-prototypes -Wmissing-variable-declarations -Werror")
|
||||||
set(OPTIMIZATION_FLAGS "-Ofast -funroll-loops -fmerge-all-constants")
|
set(OPTIMIZATION_FLAGS "-Ofast -funroll-loops -fmerge-all-constants")
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GENERAL_FLAGS} ${WARNING_FLAGS} ${OPTIMIZATION_FLAGS}")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GENERAL_FLAGS} ${WARNING_FLAGS} ${OPTIMIZATION_FLAGS}")
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(disable : 4100 4668 4710 4711 4820)
|
#pragma warning(disable : 4100 4668 4710 4711 4820)
|
||||||
|
#elif defined __clang__
|
||||||
|
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||||
|
#pragma clang diagnostic ignored "-Wmissing-prototypes"
|
||||||
#elif defined __GNUC__
|
#elif defined __GNUC__
|
||||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||||
|
#pragma GCC diagnostic ignored "-Wcast-qual"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(disable : 4100 4668 4710 4711 4820)
|
#pragma warning(disable : 4100 4668 4710 4711 4820)
|
||||||
|
#elif defined __clang__
|
||||||
|
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||||
|
#pragma clang diagnostic ignored "-Wmissing-prototypes"
|
||||||
#elif defined __GNUC__
|
#elif defined __GNUC__
|
||||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,8 +1,18 @@
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(disable : 4061 4065 4100 4152 4242 4244 4668 4702 4710 4711 4820 5045)
|
#pragma warning(disable : 4061 4065 4100 4152 4242 4244 4668 4702 4710 4711 4820 5045)
|
||||||
|
#elif defined __clang__
|
||||||
|
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||||
|
#pragma clang diagnostic ignored "-Wunused-variable"
|
||||||
|
#pragma clang diagnostic ignored "-Wmissing-prototypes"
|
||||||
|
#pragma clang diagnostic ignored "-Wunreachable-code"
|
||||||
#elif defined __GNUC__
|
#elif defined __GNUC__
|
||||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||||
|
#pragma GCC diagnostic ignored "-Wcast-qual"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef LLHTTP_STRICT_MODE
|
||||||
|
#define LLHTTP_STRICT_MODE 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LLHTTP_STRICT_MODE
|
#if LLHTTP_STRICT_MODE
|
||||||
|
|
|
@ -334,6 +334,8 @@ void* realloc_hook(void* ptr, size_t size) noexcept;
|
||||||
void* calloc_hook(size_t count, size_t size) noexcept;
|
void* calloc_hook(size_t count, size_t size) noexcept;
|
||||||
void free_hook(void* p) noexcept;
|
void free_hook(void* p) noexcept;
|
||||||
|
|
||||||
|
extern const char* BLOCK_FOUND;
|
||||||
|
|
||||||
} // namespace p2pool
|
} // namespace p2pool
|
||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
|
@ -390,8 +390,6 @@ void SideChain::unsee_block(const PoolBlock& block)
|
||||||
m_seenBlocks.erase(block.m_sidechainId);
|
m_seenBlocks.erase(block.m_sidechainId);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern const char* BLOCK_FOUND;
|
|
||||||
|
|
||||||
bool SideChain::add_external_block(PoolBlock& block, std::vector<hash>& missing_blocks)
|
bool SideChain::add_external_block(PoolBlock& block, std::vector<hash>& missing_blocks)
|
||||||
{
|
{
|
||||||
if (block.m_difficulty < m_minDifficulty) {
|
if (block.m_difficulty < m_minDifficulty) {
|
||||||
|
|
|
@ -1035,12 +1035,9 @@ bool StratumServer::StratumClient::process_request(char* data, uint32_t /*size*/
|
||||||
LOGINFO(6, "incoming keepalive from " << log::Gray() << static_cast<char*>(m_addrString));
|
LOGINFO(6, "incoming keepalive from " << log::Gray() << static_cast<char*>(m_addrString));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
LOGWARN(4, "client " << static_cast<char*>(m_addrString) << " invalid JSON request (unknown method)");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
LOGWARN(4, "client " << static_cast<char*>(m_addrString) << " invalid JSON request (unknown method)");
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StratumServer::StratumClient::process_login(rapidjson::Document& doc, uint32_t id)
|
bool StratumServer::StratumClient::process_login(rapidjson::Document& doc, uint32_t id)
|
||||||
|
|
|
@ -221,6 +221,10 @@ FORCEINLINE uint64_t bsr(uint64_t x)
|
||||||
|
|
||||||
} // namespace p2pool
|
} // namespace p2pool
|
||||||
|
|
||||||
|
void memory_tracking_start();
|
||||||
|
void memory_tracking_stop();
|
||||||
|
void p2pool_usage();
|
||||||
|
|
||||||
namespace robin_hood {
|
namespace robin_hood {
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
|
|
Loading…
Reference in New Issue