Skip to content

Commit

Permalink
build: Suppress warnings (#8948)
Browse files Browse the repository at this point in the history
ref #7193
  • Loading branch information
Lloyd-Pottiger authored Apr 15, 2024
1 parent 1df6e16 commit 73f37f6
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 20 deletions.
5 changes: 5 additions & 0 deletions contrib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ if (USE_INTERNAL_POCO_LIBRARY)
set (ENABLE_DATA_ODBC 0 CACHE INTERNAL "") # TODO (build fail)
endif ()
add_subdirectory (poco)
target_compile_options(Net PUBLIC "-Wno-error=deprecated-declarations")
target_compile_options(Net PUBLIC "-Wno-deprecated-declarations")
target_no_warning(NetSSL deprecated-declarations)
target_no_warning(Foundation deprecated-declarations)
target_no_warning(Net deprecated-enum-enum-conversion)
unset (CMAKE_DISABLE_FIND_PACKAGE_ZLIB)
set (ENABLE_TESTS ${_save})
set (CMAKE_CXX_FLAGS ${save_CMAKE_CXX_FLAGS})
Expand Down
1 change: 1 addition & 0 deletions contrib/boost-cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ target_compile_definitions (boost_internal PUBLIC BOOST_BIND_GLOBAL_PLACEHOLDERS
target_no_warning(boost_internal unused-but-set-variable)
target_no_warning(boost_internal deprecated-builtins)
target_no_warning(boost_internal non-virtual-dtor)
target_no_warning(boost_internal deprecated-declarations)
1 change: 1 addition & 0 deletions contrib/boringssl-cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@ add_library(
"${BORINGSSL_SOURCE_DIR}/crypto/x509v3/v3_skey.c"
"${BORINGSSL_SOURCE_DIR}/crypto/x509v3/v3_utl.c"
)
target_compile_options(crypto PRIVATE "-Wno-unused-but-set-variable")

add_library(
ssl
Expand Down
2 changes: 2 additions & 0 deletions contrib/libunwind-cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,5 @@ target_include_directories (unwind PUBLIC ${LIBUNWIND_SOURCE_DIR}/include)
target_include_directories (unwind PRIVATE ${LIBUNWIND_SOURCE_DIR}/include/tdep)
target_include_directories (unwind PRIVATE ${LIBUNWIND_SOURCE_DIR}/src)
target_include_directories (unwind PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/include)
target_compile_options (unwind PRIVATE "-Wno-single-bit-bitfield-constant-conversion")
target_compile_options (unwind PRIVATE "-Wno-absolute-value")
1 change: 1 addition & 0 deletions contrib/protobuf-cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ set(libprotoc_files

add_library(libprotoc ${libprotoc_files})
target_link_libraries(libprotoc libprotobuf)
target_compile_options(libprotoc PRIVATE "-Wno-deprecated-pragma")
add_library(protobuf::libprotoc ALIAS libprotoc)

set(protoc_files ${protobuf_source_dir}/src/google/protobuf/compiler/main.cc)
Expand Down
1 change: 1 addition & 0 deletions dbms/src/Common/RemoteHostFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <common/defines.h>

#include <atomic>
#include <mutex>
#include <string>
#include <unordered_set>
Expand Down
2 changes: 2 additions & 0 deletions dbms/src/IO/BaseFile/WritableFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#pragma once

#include <sys/types.h>

#include <memory>

namespace DB
Expand Down
2 changes: 2 additions & 0 deletions dbms/src/IO/Encryption/tests/gtest_encryption_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ try
EncryptionMethod::Aes128Ctr,
EncryptionMethod::Aes192Ctr,
EncryptionMethod::Aes256Ctr,
#if USE_GM_SSL
EncryptionMethod::SM4Ctr,
#endif
};
for (size_t i = 0; i < 10; ++i)
{
Expand Down
1 change: 1 addition & 0 deletions dbms/src/Storages/DeltaMerge/StoragePool/StoragePool_fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#pragma once

#include <chrono>
#include <memory>

namespace DB::DM
Expand Down
28 changes: 12 additions & 16 deletions dbms/src/Storages/KVStore/tests/gtest_kvstore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include <Storages/KVStore/MultiRaft/RegionsRangeIndex.h>
#include <Storages/KVStore/tests/kvstore_helper.h>

#include <regex>


namespace DB::tests
{
Expand Down Expand Up @@ -1542,9 +1544,8 @@ TEST_F(RegionKVStoreOldTest, RegionRange)
catch (Exception & e)
{
const auto & res = e.message();
ASSERT_EQ(
res,
"void DB::RegionsRangeIndex::remove(const DB::RegionRange &, DB::RegionID): not found region_id=1");
std::regex msg_reg(".*: not found region_id=1");
ASSERT_TRUE(std::regex_match(res, msg_reg));
}

region_index.add(makeRegion(2, RecordKVFormat::genKey(1, 3), RecordKVFormat::genKey(1, 5)));
Expand All @@ -1558,9 +1559,8 @@ TEST_F(RegionKVStoreOldTest, RegionRange)
catch (Exception & e)
{
const auto & res = e.message();
ASSERT_EQ(
res,
"void DB::RegionsRangeIndex::remove(const DB::RegionRange &, DB::RegionID): not found start key");
std::regex msg_reg(".*: not found start key");
ASSERT_TRUE(std::regex_match(res, msg_reg));
}

try
Expand All @@ -1573,9 +1573,8 @@ TEST_F(RegionKVStoreOldTest, RegionRange)
catch (Exception & e)
{
const auto & res = e.message();
ASSERT_EQ(
res,
"void DB::RegionsRangeIndex::remove(const DB::RegionRange &, DB::RegionID): not found end key");
std::regex msg_reg(".*: not found end key");
ASSERT_TRUE(std::regex_match(res, msg_reg));
}

try
Expand All @@ -1588,10 +1587,8 @@ TEST_F(RegionKVStoreOldTest, RegionRange)
catch (Exception & e)
{
const auto & res = e.message();
ASSERT_EQ(
res,
"void DB::RegionsRangeIndex::remove(const DB::RegionRange &, DB::RegionID): range of region_id=2 is "
"empty");
std::regex msg_reg(".*: range of region_id=2 is empty");
ASSERT_TRUE(std::regex_match(res, msg_reg));
}

try
Expand All @@ -1602,9 +1599,8 @@ TEST_F(RegionKVStoreOldTest, RegionRange)
catch (Exception & e)
{
const auto & res = e.message();
ASSERT_EQ(
res,
"void DB::RegionsRangeIndex::remove(const DB::RegionRange &, DB::RegionID): not found region_id=2");
std::regex msg_reg(".*: not found region_id=2");
ASSERT_TRUE(std::regex_match(res, msg_reg));
}

region_index.clear();
Expand Down
3 changes: 2 additions & 1 deletion dbms/src/Storages/S3/FileCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <chrono>
#include <cmath>
#include <filesystem>
#include <fstream>

namespace ProfileEvents
{
Expand All @@ -56,6 +55,8 @@ namespace DB
{
using FileType = FileSegment::FileType;

std::unique_ptr<FileCache> FileCache::global_file_cache_instance;

FileCache::FileCache(PathCapacityMetricsPtr capacity_metrics_, const StorageRemoteCacheConfig & config_)
: capacity_metrics(capacity_metrics_)
, cache_dir(config_.getDTFileCacheDir())
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Storages/S3/FileCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class FileCache
#endif

inline static std::atomic<bool> global_file_cache_initialized{false};
inline static std::unique_ptr<FileCache> global_file_cache_instance;
static std::unique_ptr<FileCache> global_file_cache_instance;

DISALLOW_COPY_AND_MOVE(FileCache);

Expand Down
2 changes: 1 addition & 1 deletion dbms/src/TiDB/Schema/SchemaSyncService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void SchemaSyncService::addKeyspaceGCTasks()
UInt64 num_add_tasks = 0;
// Add new sync schema task for new keyspace.
std::unique_lock<std::shared_mutex> lock(keyspace_map_mutex);
for (auto const iter : keyspaces)
for (auto const & iter : keyspaces)
{
auto keyspace = iter.first;
if (keyspace_handle_map.contains(keyspace))
Expand Down
2 changes: 1 addition & 1 deletion libs/libcommon/include/common/ThreadPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#pragma once

#include <condition_variable>
#include <cstdint>
#include <exception>
#include <functional>
#include <mutex>
#include <queue>
Expand Down

0 comments on commit 73f37f6

Please sign in to comment.