From f1796eaf90284e720552d63e25a27e63c2e8a9ff Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 26 Oct 2015 12:04:20 +0200 Subject: [PATCH] GCC warnings. Don't use PCH if use ccache. --HG-- branch : develop --- common.pri | 22 ++++++++++++---------- src/libs/qmuparser/qmuparser.cpp | 4 ++-- src/libs/qmuparser/qmuparsertest.cpp | 4 ++-- src/libs/vdxf/dxflib/dl_writer_ascii.cpp | 1 + src/libs/vlayout/vlayout.pro | 5 +++++ 5 files changed, 22 insertions(+), 14 deletions(-) diff --git a/common.pri b/common.pri index 0f9657695..dbf41753a 100644 --- a/common.pri +++ b/common.pri @@ -100,18 +100,20 @@ defineTest(forceCopyToDestdir) { # We use precompiled headers for more fast compilation source code. defineReplace(set_PCH){ - macx:clang*{ - # Precompiled headers don't work with clang on macx. - } else { - CONFIG += precompile_header # Turn on creation precompiled headers (PCH). - export(CONFIG) # export value to global variable. + unix:no_ccache|win32{ + macx:clang*{ + # Precompiled headers don't work with clang on macx. + } else { + CONFIG += precompile_header # Turn on creation precompiled headers (PCH). + export(CONFIG) # export value to global variable. - PRECOMPILED_HEADER = stable.h # Header file with all all static headers: libraries, static local headers. - export(PRECOMPILED_HEADER) # export value to global variable + PRECOMPILED_HEADER = stable.h # Header file with all all static headers: libraries, static local headers. + export(PRECOMPILED_HEADER) # export value to global variable - win32-msvc* { - PRECOMPILED_SOURCE = stable.cpp # MSVC need also cpp file. - export(PRECOMPILED_SOURCE) # export value to global variable. + win32-msvc* { + PRECOMPILED_SOURCE = stable.cpp # MSVC need also cpp file. + export(PRECOMPILED_SOURCE) # export value to global variable. + } } } return(true) diff --git a/src/libs/qmuparser/qmuparser.cpp b/src/libs/qmuparser/qmuparser.cpp index fdab2e0a9..249352fac 100644 --- a/src/libs/qmuparser/qmuparser.cpp +++ b/src/libs/qmuparser/qmuparser.cpp @@ -322,8 +322,8 @@ void QmuParser::InitFun() */ void QmuParser::InitConst() { - DefineConst("_pi", (qreal)M_PI); - DefineConst("_e", (qreal)M_E); + DefineConst("_pi", static_cast(M_PI)); + DefineConst("_e", static_cast(M_E)); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/qmuparser/qmuparsertest.cpp b/src/libs/qmuparser/qmuparsertest.cpp index 8b5d77005..3e6b16fa2 100644 --- a/src/libs/qmuparser/qmuparsertest.cpp +++ b/src/libs/qmuparser/qmuparsertest.cpp @@ -1264,8 +1264,8 @@ int QmuParserTester::EqnTest ( const QString &a_str, double a_fRes, bool a_fPass p1.reset ( new qmu::QmuParser() ); // Add constants - p1->DefineConst ( "pi", ( qreal ) M_PI ); - p1->DefineConst ( "e", ( qreal ) M_E ); + p1->DefineConst ( "pi", static_cast(M_PI) ); + p1->DefineConst ( "e", static_cast(M_E) ); p1->DefineConst ( "const", 1 ); p1->DefineConst ( "const1", 2 ); p1->DefineConst ( "const2", 3 ); diff --git a/src/libs/vdxf/dxflib/dl_writer_ascii.cpp b/src/libs/vdxf/dxflib/dl_writer_ascii.cpp index 295934b50..932ec9ac4 100644 --- a/src/libs/vdxf/dxflib/dl_writer_ascii.cpp +++ b/src/libs/vdxf/dxflib/dl_writer_ascii.cpp @@ -31,6 +31,7 @@ #include #include +#include #include "dl_writer_ascii.h" diff --git a/src/libs/vlayout/vlayout.pro b/src/libs/vlayout/vlayout.pro index 3daacee7c..23b723fb0 100644 --- a/src/libs/vlayout/vlayout.pro +++ b/src/libs/vlayout/vlayout.pro @@ -59,6 +59,11 @@ CONFIG(debug, debug|release){ -isystem "$${OUT_PWD}/$${RCC_DIR}" \ $$GCC_DEBUG_CXXFLAGS # See common.pri for more details. + # -isystem key works only for headers. In some cases it's not enough. But we can't delete these warnings and + # want them in the global list. Compromise decision is to delete them from the local list. + QMAKE_CXXFLAGS -= \ + -Wno-long-long \ + noAddressSanitizer{ # For enable run qmake with CONFIG+=noAddressSanitizer # do nothing } else {