From 794276514e15796355e8e8cbf7d6e0679968a5d8 Mon Sep 17 00:00:00 2001 From: Steven Hahn <hahnse@ornl.gov> Date: Thu, 25 Feb 2016 11:46:55 -0500 Subject: [PATCH] Sync OS X and Linux warning flags. --- Framework/ICat/src/GSoap/stdsoap2.cpp | 9 ++++++ .../MatrixWSDataSource.h | 31 +++++++++---------- buildconfig/CMake/CommonSetup.cmake | 5 +-- buildconfig/CMake/DarwinSetup.cmake | 8 +---- 4 files changed, 25 insertions(+), 28 deletions(-) diff --git a/Framework/ICat/src/GSoap/stdsoap2.cpp b/Framework/ICat/src/GSoap/stdsoap2.cpp index 9868a9640d9..cccb4c51c67 100644 --- a/Framework/ICat/src/GSoap/stdsoap2.cpp +++ b/Framework/ICat/src/GSoap/stdsoap2.cpp @@ -1,3 +1,8 @@ +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcast-align" +#endif + /* stdsoap2.c[pp] 2.8.15 @@ -17002,3 +17007,7 @@ soap::~soap() { #endif /******************************************************************************/ + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif diff --git a/MantidQt/SpectrumViewer/inc/MantidQtSpectrumViewer/MatrixWSDataSource.h b/MantidQt/SpectrumViewer/inc/MantidQtSpectrumViewer/MatrixWSDataSource.h index 1c693a9c6c9..674df042655 100644 --- a/MantidQt/SpectrumViewer/inc/MantidQtSpectrumViewer/MatrixWSDataSource.h +++ b/MantidQt/SpectrumViewer/inc/MantidQtSpectrumViewer/MatrixWSDataSource.h @@ -62,31 +62,28 @@ class EXPORT_OPT_MANTIDQT_SPECTRUMVIEWER MatrixWSDataSource: public SpectrumData ~MatrixWSDataSource(); - virtual bool hasData(const std::string& wsName, const boost::shared_ptr<Mantid::API::Workspace> ws); + bool hasData(const std::string &wsName, + const boost::shared_ptr<Mantid::API::Workspace> ws) override; - /// OVERRIDES: Get the smallest 'x' value covered by the data - virtual double getXMin(); + /// Get the smallest 'x' value covered by the data + double getXMin() override; - /// OVERRIDES: Get the largest 'x' value covered by the data - virtual double getXMax(); + /// Get the largest 'x' value covered by the data + double getXMax() override; - /// OVERRIDES: Get the largest 'y' value covered by the data - virtual double getYMax(); + /// Get the largest 'y' value covered by the data + double getYMax() override; - /// OVERRIDES: Get the total number of rows of data - virtual size_t getNRows(); + /// Get the total number of rows of data + size_t getNRows() override; /// Get DataArray covering full range of data in x, and y directions - DataArray_const_sptr getDataArray( bool isLogX ); + DataArray_const_sptr getDataArray(bool isLogX) override; /// Get DataArray covering restricted range of data - DataArray_const_sptr getDataArray( double xMin, - double xMax, - double yMin, - double yMax, - size_t nRows, - size_t nCols, - bool isLogX ); + DataArray_const_sptr getDataArray(double xMin, double xMax, double yMin, + double yMax, size_t nRows, size_t nCols, + bool isLogX) override; /// Set the class that gets the emode & efixed info from the user. void setEModeHandler( EModeHandler* emodeHandler ); diff --git a/buildconfig/CMake/CommonSetup.cmake b/buildconfig/CMake/CommonSetup.cmake index e687e43311f..356fe19953d 100644 --- a/buildconfig/CMake/CommonSetup.cmake +++ b/buildconfig/CMake/CommonSetup.cmake @@ -247,10 +247,7 @@ endif () if ( CMAKE_COMPILER_IS_GNUCXX ) include ( GNUSetup ) elseif ( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" ) - # Remove once clang warnings have been fixed. - if ( NOT APPLE) - include ( GNUSetup ) - endif () + include ( GNUSetup ) endif () ########################################################################### diff --git a/buildconfig/CMake/DarwinSetup.cmake b/buildconfig/CMake/DarwinSetup.cmake index ad86be1e3c8..79aa19b58d0 100644 --- a/buildconfig/CMake/DarwinSetup.cmake +++ b/buildconfig/CMake/DarwinSetup.cmake @@ -63,9 +63,6 @@ endif () # Force 64-bit compiler as that's all we support ########################################################################### -set ( CLANG_WARNINGS "-Wall -Wextra -pedantic -Wconversion -Wno-sign-conversion -Winit-self -Wpointer-arith -Wcast-qual -fno-common -Wno-deprecated-declarations") - -set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64 ${CLANG_WARNINGS}" ) if(${CMAKE_VERSION} VERSION_GREATER 3.1.0 OR ${CMAKE_VERSION} VERSION_EQUAL 3.1.0) set(CMAKE_CXX_STANDARD 14) set(CXX_STANDARD_REQUIRED 11) @@ -80,12 +77,9 @@ else() endif() endif() -if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -stdlib=libc++ ${CLANG_WARNINGS}" ) -endif() # XCode isn't picking up the standard set above. if(CMAKE_GENERATOR STREQUAL Xcode) - set ( CMAKE_XCODE_ATTRIBUTE_OTHER_CPLUSPLUSFLAGS "${CLANG_WARNINGS}") + set ( CMAKE_XCODE_ATTRIBUTE_OTHER_CPLUSPLUSFLAGS "${GNUFLAGS}") set ( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++" ) set ( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14") endif() -- GitLab