Skip to content

Commit

Permalink
Fix gcc 10 (pingcap#2809)
Browse files Browse the repository at this point in the history
SchrodingerZhu authored Sep 1, 2021
1 parent 125df94 commit 2ceb880
Showing 5 changed files with 13 additions and 6 deletions.
4 changes: 4 additions & 0 deletions dbms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -28,6 +28,10 @@ if (NOT NO_WERROR)
endif ()

find_package (Threads)
find_package (CURL) # CURL_LIBRARIES can be unset till this file, so we find it explicitly
if (TARGET CURL::libcurl)
set(CURL_LIBRARIES CURL::libcurl)
endif()

if (ENABLE_FAILPOINTS)
add_definitions(-DFIU_ENABLE)
11 changes: 8 additions & 3 deletions dbms/src/Core/Field.h
Original file line number Diff line number Diff line change
@@ -41,6 +41,8 @@ bool decimalLess(T x, T y, UInt32 x_scale, UInt32 y_scale);
template <typename T>
bool decimalLessOrEqual(T x, T y, UInt32 x_scale, UInt32 y_scale);

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" // this one should be a false positive
template <typename T>
class DecimalField
{
@@ -156,10 +158,10 @@ class DecimalField


private:
T dec;
UInt32 scale;
T dec{};
UInt32 scale{};
};

#pragma GCC diagnostic pop
/** Discriminated union of several types.
* Made for replacement of `boost::variant`
* is not generalized,
@@ -519,6 +521,8 @@ class Field


/// Assuming there was no allocated state or it was deallocated (see destroy).
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
template <typename T>
void createConcrete(T && x)
{
@@ -527,6 +531,7 @@ class Field
new (ptr) JustT(std::forward<T>(x));
which = TypeToEnum<JustT>::value;
}
#pragma GCC diagnostic pop

/// Assuming same types.
template <typename T>
1 change: 0 additions & 1 deletion dbms/src/Parsers/ASTSetQuery.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#pragma once

#include <Common/FieldVisitors.h>
#include <Core/Field.h>
#include <Parsers/IAST.h>
2 changes: 0 additions & 2 deletions dbms/src/Parsers/ParserSetQuery.cpp
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@
#include <Parsers/CommonParsers.h>
#include <Parsers/ParserSetQuery.h>


namespace DB
{
/// Parse `name = value`.
@@ -33,7 +32,6 @@ static bool parseNameValuePair(ASTSetQuery::Change & change, IParser::Pos & pos,
return true;
}


bool ParserSetQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected)
{
ParserToken s_comma(TokenType::Comma);
1 change: 1 addition & 0 deletions libs/libcommon/include/common/types.h
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#if defined(__clang__)
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma GCC diagnostic ignored "-Wdeprecated-copy"

0 comments on commit 2ceb880

Please sign in to comment.