Enabling -Wzero-as-null-pointer-constant [#CLICKHOUSE-2]

This commit is contained in:
Alexey Milovidov 2018-08-26 04:56:34 +03:00
parent 936c21de1f
commit a1a70d4a65
7 changed files with 21 additions and 18 deletions

View File

@ -269,10 +269,5 @@ if (ENABLE_TESTS)
grep_gtest_sources(${ClickHouse_SOURCE_DIR}/dbms dbms_gtest_sources) grep_gtest_sources(${ClickHouse_SOURCE_DIR}/dbms dbms_gtest_sources)
add_executable(unit_tests_dbms ${dbms_gtest_sources}) add_executable(unit_tests_dbms ${dbms_gtest_sources})
target_link_libraries(unit_tests_dbms gtest_main dbms) target_link_libraries(unit_tests_dbms gtest_main dbms)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_definitions(unit_tests_dbms INTERFACE "-Wno-zero-as-null-pointer-constant")
endif ()
add_check(unit_tests_dbms) add_check(unit_tests_dbms)
endif () endif ()

View File

@ -5,14 +5,15 @@
#include <iostream> #include <iostream>
#include <chrono> #include <chrono>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-compare" #pragma GCC diagnostic ignored "-Wsign-compare"
#ifdef __clang__
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
#endif
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <Common/ShellCommand.h> #include <Common/ShellCommand.h>
#pragma GCC diagnostic pop
using namespace DB; using namespace DB;
TEST(zkutil, zookeeper_connected) TEST(zkutil, zookeeper_connected)

View File

@ -1,7 +1,8 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-compare" #pragma GCC diagnostic ignored "-Wsign-compare"
#ifdef __clang__
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
#endif
#include <gtest/gtest.h> #include <gtest/gtest.h>
#pragma GCC diagnostic pop
#include <Common/RWLockFIFO.h> #include <Common/RWLockFIFO.h>
#include <Common/Stopwatch.h> #include <Common/Stopwatch.h>

View File

@ -1,9 +1,11 @@
#include <Common/escapeForFileName.h> #include <Common/escapeForFileName.h>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-compare" #pragma GCC diagnostic ignored "-Wsign-compare"
#ifdef __clang__
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
#endif
#include <gtest/gtest.h> #include <gtest/gtest.h>
#pragma GCC diagnostic pop
using namespace DB; using namespace DB;

View File

@ -4,11 +4,12 @@
#include <sstream> #include <sstream>
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-compare" #pragma GCC diagnostic ignored "-Wsign-compare"
#ifdef __clang__
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
#endif
#include <gtest/gtest.h> #include <gtest/gtest.h>
#pragma GCC diagnostic pop
using namespace DB; using namespace DB;

View File

@ -1,7 +1,8 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-compare" #pragma GCC diagnostic ignored "-Wsign-compare"
#ifdef __clang__
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
#endif
#include <gtest/gtest.h> #include <gtest/gtest.h>
#pragma GCC diagnostic pop
#include <stdexcept> #include <stdexcept>
#include <Poco/File.h> #include <Poco/File.h>

View File

@ -1,9 +1,11 @@
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-compare" #pragma GCC diagnostic ignored "-Wsign-compare"
#ifdef __clang__
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
#endif
#include <gtest/gtest.h> #include <gtest/gtest.h>
#pragma GCC diagnostic pop
#include <DataStreams/ColumnGathererStream.h> #include <DataStreams/ColumnGathererStream.h>
using DB::RowSourcePart; using DB::RowSourcePart;
static void check(const RowSourcePart & s, size_t num, bool flag) static void check(const RowSourcePart & s, size_t num, bool flag)