From 14d58737dd6ee74e4e3a18b6865d82f265f5a809 Mon Sep 17 00:00:00 2001 From: Vitaly Baranov Date: Sat, 27 Apr 2019 00:58:14 +0300 Subject: [PATCH] Fix error: use of old-style cast --- dbms/src/Functions/FunctionsJSON.cpp | 2 +- dbms/src/Functions/FunctionsJSON.h | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dbms/src/Functions/FunctionsJSON.cpp b/dbms/src/Functions/FunctionsJSON.cpp index 2227febd4cc..9daaa394352 100644 --- a/dbms/src/Functions/FunctionsJSON.cpp +++ b/dbms/src/Functions/FunctionsJSON.cpp @@ -163,7 +163,7 @@ public: if (which.isFloat()) { if (pjh.is_integer()) - return {(double)pjh.get_integer()}; + return {static_cast(pjh.get_integer())}; else if (pjh.is_double()) return {pjh.get_double()}; else diff --git a/dbms/src/Functions/FunctionsJSON.h b/dbms/src/Functions/FunctionsJSON.h index c9011157d85..fb1cffc19a3 100644 --- a/dbms/src/Functions/FunctionsJSON.h +++ b/dbms/src/Functions/FunctionsJSON.h @@ -5,9 +5,18 @@ #include #include #include +#include + +#ifdef __clang__ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wold-style-cast" +#endif #include -#include + +#ifdef __clang__ + #pragma clang diagnostic pop +#endif namespace DB