diff --git a/bindings/CXX11/adios2/cxx11/fstream/ADIOS2fstream.tcc b/bindings/CXX11/adios2/cxx11/fstream/ADIOS2fstream.tcc index e9e258455e..491e5e8835 100644 --- a/bindings/CXX11/adios2/cxx11/fstream/ADIOS2fstream.tcc +++ b/bindings/CXX11/adios2/cxx11/fstream/ADIOS2fstream.tcc @@ -15,6 +15,19 @@ #include "adios2/core/Stream.h" + +#if defined(_MSC_VER) +#pragma warning( push ) +//#pragma warning( disable : 4101) +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" + +#elif defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-wstrict-aliasing" +#endif + namespace adios2 { @@ -182,4 +195,13 @@ std::vector fstream::read_attribute(const std::string &name, } // end namespace adios2 + +#if defined(_MSC_VER) +#pragma warning( pop ) +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#elif defined(__clang__) +#pragma clang diagnostic pop +#endif + #endif /* ADIOS2_BINDINGS_CXX11_CXX11_FSTREAM_ADIOS2FSTREAM_TCC_ */ diff --git a/cmake/DetectOptions.cmake b/cmake/DetectOptions.cmake index b820e42544..4981a138c1 100644 --- a/cmake/DetectOptions.cmake +++ b/cmake/DetectOptions.cmake @@ -150,6 +150,7 @@ if(ADIOS2_USE_Fortran STREQUAL AUTO) endif() elseif(ADIOS2_USE_Fortran) enable_language(Fortran) + string(APPEND CMAKE_Fortran_FLAGS_DEBUG " -Wall") endif() if(CMAKE_Fortran_COMPILER_LOADED) set(ADIOS2_HAVE_Fortran TRUE) diff --git a/cmake/FindPythonModule.cmake b/cmake/FindPythonModule.cmake index 4f9cf29f57..7a71efb78c 100644 --- a/cmake/FindPythonModule.cmake +++ b/cmake/FindPythonModule.cmake @@ -141,7 +141,7 @@ if(PythonModule_${module_NAME}_FOUND AND add_library(${module_NAME} INTERFACE) add_library(Python::${module_NAME} ALIAS ${module_NAME}) foreach(inc_var IN LISTS include_vars) - target_include_directories(${module_NAME} INTERFACE ${${inc_var}}) + target_include_directories(${module_NAME} SYSTEM INTERFACE ${${inc_var}}) endforeach() foreach(lib_var IN LISTS library_vars) target_link_libraries(${module_NAME} INTERFACE ${${lib_var}}) diff --git a/examples/basics/values/values_write.cpp b/examples/basics/values/values_write.cpp index 668cffa62c..5e6070664f 100644 --- a/examples/basics/values/values_write.cpp +++ b/examples/basics/values/values_write.cpp @@ -71,6 +71,7 @@ int main(int argc, char *argv[]) */ // 1. Global constant, same value across processes, constant over time adios2::Variable varNproc = io.DefineVariable("Nproc"); + (void)varNproc; // For the sake of the example we create an unused variable // 2. Global value, same value across processes, varying value over time adios2::Variable varStep = io.DefineVariable("Step"); diff --git a/examples/hello/bpReader/helloBPReader_nompi.cpp b/examples/hello/bpReader/helloBPReader_nompi.cpp index 776543d8a5..7e5038c6c9 100644 --- a/examples/hello/bpReader/helloBPReader_nompi.cpp +++ b/examples/hello/bpReader/helloBPReader_nompi.cpp @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) bpIO.AvailableVariables(true); std::cout << "List of variables:"; - for (const auto variablePair : variables) + for (const auto& variablePair : variables) { std::cout << " " << variablePair.first; } diff --git a/examples/hello/bpWriter/helloBPSubStreams.cpp b/examples/hello/bpWriter/helloBPSubStreams.cpp index 73e9412775..2a2fabcf2a 100644 --- a/examples/hello/bpWriter/helloBPSubStreams.cpp +++ b/examples/hello/bpWriter/helloBPSubStreams.cpp @@ -67,6 +67,7 @@ int main(int argc, char *argv[]) adios2::Attribute attribute = bpIO.DefineAttribute("attrINT", -1); + (void)attribute; // For the sake of the example we create an unused variable /** Engine derived class, spawned to start IO operations */ adios2::Engine bpFileWriter = diff --git a/examples/hello/bpWriter/helloBPWriter.cpp b/examples/hello/bpWriter/helloBPWriter.cpp index e67c82ba92..4d93a35f72 100644 --- a/examples/hello/bpWriter/helloBPWriter.cpp +++ b/examples/hello/bpWriter/helloBPWriter.cpp @@ -63,6 +63,7 @@ int main(int argc, char *argv[]) adios2::Variable bpString = bpIO.DefineVariable("bpString"); + (void)bpString; // For the sake of the example we create an unused variable std::string filename = "myVector_cpp.bp"; /** Engine derived class, spawned to start IO operations */ diff --git a/examples/hello/hdf5Reader/helloHDF5Reader_nompi.cpp b/examples/hello/hdf5Reader/helloHDF5Reader_nompi.cpp index a6f64151ad..22e2dd9922 100644 --- a/examples/hello/hdf5Reader/helloHDF5Reader_nompi.cpp +++ b/examples/hello/hdf5Reader/helloHDF5Reader_nompi.cpp @@ -93,7 +93,7 @@ int main(int argc, char *argv[]) const std::map variables = h5IO.AvailableVariables(); - for (const auto variablePair : variables) + for (const auto& variablePair : variables) { std::cout << "Name: " << variablePair.first; std::cout << std::endl; diff --git a/scripts/ci/cmake/ci-el7-gnu8-ohpc.cmake b/scripts/ci/cmake/ci-el7-gnu8-ohpc.cmake index 6bbc905f82..a315186076 100644 --- a/scripts/ci/cmake/ci-el7-gnu8-ohpc.cmake +++ b/scripts/ci/cmake/ci-el7-gnu8-ohpc.cmake @@ -10,9 +10,9 @@ env_module(load hdf5) set(ENV{CC} gcc) set(ENV{CXX} g++) set(ENV{FC} gfortran) -set(ENV{CFLAGS} "-Werror -Wno-error=builtin-declaration-mismatch") -set(ENV{CXXFLAGS} "-Werror -Wno-error=builtin-declaration-mismatch") -set(ENV{FFLAGS} "-Werror -Wno-error=builtin-declaration-mismatch") +set(ENV{CFLAGS} "-Werror -Wall -Wno-error=builtin-declaration-mismatch") +set(ENV{CXXFLAGS} "-Werror -Wall -Wno-error=builtin-declaration-mismatch") +set(ENV{FFLAGS} "-Werror -Wall -Wno-error=builtin-declaration-mismatch") set(dashboard_cache " ADIOS2_USE_BZip2:BOOL=ON diff --git a/scripts/ci/cmake/ci-el7-gnu8-openmpi-ohpc-static.cmake b/scripts/ci/cmake/ci-el7-gnu8-openmpi-ohpc-static.cmake index 581be161aa..2d2fabdbe7 100644 --- a/scripts/ci/cmake/ci-el7-gnu8-openmpi-ohpc-static.cmake +++ b/scripts/ci/cmake/ci-el7-gnu8-openmpi-ohpc-static.cmake @@ -16,9 +16,9 @@ env_module(load py3-mpi4py) set(ENV{CC} gcc) set(ENV{CXX} g++) set(ENV{FC} gfortran) -set(ENV{CFLAGS} "-Werror -Wno-error=builtin-declaration-mismatch") -set(ENV{CXXFLAGS} "-Werror -Wno-error=builtin-declaration-mismatch") -set(ENV{FFLAGS} "-Werror -Wno-error=builtin-declaration-mismatch") +set(ENV{CFLAGS} "-Werror -Wall -Wno-error=builtin-declaration-mismatch") +set(ENV{CXXFLAGS} "-Werror -Wall -Wno-error=builtin-declaration-mismatch") +set(ENV{FFLAGS} "-Werror -Wall -Wno-error=builtin-declaration-mismatch") set(dashboard_cache " BUILD_SHARED_LIBS:BOOL=OFF diff --git a/scripts/ci/cmake/ci-el7-gnu8-openmpi-ohpc.cmake b/scripts/ci/cmake/ci-el7-gnu8-openmpi-ohpc.cmake index 16f5ccf725..934d53119e 100644 --- a/scripts/ci/cmake/ci-el7-gnu8-openmpi-ohpc.cmake +++ b/scripts/ci/cmake/ci-el7-gnu8-openmpi-ohpc.cmake @@ -16,9 +16,9 @@ env_module(load py3-mpi4py) set(ENV{CC} gcc) set(ENV{CXX} g++) set(ENV{FC} gfortran) -set(ENV{CFLAGS} "-Werror -Wno-error=builtin-declaration-mismatch") -set(ENV{CXXFLAGS} "-Werror -Wno-error=builtin-declaration-mismatch") -set(ENV{FFLAGS} "-Werror -Wno-error=builtin-declaration-mismatch") +set(ENV{CFLAGS} "-Werror -Wall -Wno-error=builtin-declaration-mismatch") +set(ENV{CXXFLAGS} "-Werror -Wall -Wno-error=builtin-declaration-mismatch") +set(ENV{FFLAGS} "-Werror -Wall -Wno-error=builtin-declaration-mismatch") set(dashboard_cache " ADIOS2_USE_BZip2:BOOL=ON diff --git a/scripts/ci/cmake/ci-el7-intel-ohpc.cmake b/scripts/ci/cmake/ci-el7-intel-ohpc.cmake index 6aec07e815..4f3fec2b17 100644 --- a/scripts/ci/cmake/ci-el7-intel-ohpc.cmake +++ b/scripts/ci/cmake/ci-el7-intel-ohpc.cmake @@ -10,9 +10,9 @@ env_module(load hdf5) set(ENV{CC} icc) set(ENV{CXX} icpc) set(ENV{FC} ifort) -set(ENV{CFLAGS} -Werror) -set(ENV{CXXFLAGS} -Werror) -set(ENV{FFLAGS} "-warn errors") +set(ENV{CFLAGS} "-Werror -Wall") +set(ENV{CXXFLAGS} "-Werror -Wall") +set(ENV{FFLAGS} "-warn errors") set(dashboard_cache " ADIOS2_USE_BZip2:BOOL=ON diff --git a/scripts/ci/cmake/ci-el7-intel-openmpi-ohpc.cmake b/scripts/ci/cmake/ci-el7-intel-openmpi-ohpc.cmake index 696ca55aad..65377d9142 100644 --- a/scripts/ci/cmake/ci-el7-intel-openmpi-ohpc.cmake +++ b/scripts/ci/cmake/ci-el7-intel-openmpi-ohpc.cmake @@ -16,9 +16,9 @@ env_module(load py3-mpi4py) set(ENV{CC} icc) set(ENV{CXX} icpc) set(ENV{FC} ifort) -set(ENV{CFLAGS} -Werror) -set(ENV{CXXFLAGS} -Werror) -set(ENV{FFLAGS} "-warn errors") +set(ENV{CFLAGS} "-Werror -Wall -Wall") +set(ENV{CXXFLAGS} "-Werror -Wall -Wall") +set(ENV{FFLAGS} "-warn errors") set(dashboard_cache " ADIOS2_USE_BZip2:BOOL=ON diff --git a/scripts/ci/cmake/ci-el7-spack.cmake b/scripts/ci/cmake/ci-el7-spack.cmake index 6fcd590243..28c666ff5b 100644 --- a/scripts/ci/cmake/ci-el7-spack.cmake +++ b/scripts/ci/cmake/ci-el7-spack.cmake @@ -7,6 +7,9 @@ math(EXPR N2CPUS "${NCPUS}*2") set(ENV{CC} gcc) set(ENV{CXX} g++) set(ENV{FC} gfortran) +set(ENV{CFLAGS} "-Werror -Wall") +set(ENV{CXXFLAGS} "-Werror -Wall") +set(ENV{FFLAGS} "-Werror -Wall") set(dashboard_cache " ADIOS2_USE_BZip2:BOOL=ON diff --git a/scripts/ci/cmake/ci-el7.cmake b/scripts/ci/cmake/ci-el7.cmake index 4ee0370760..21d6190cf2 100644 --- a/scripts/ci/cmake/ci-el7.cmake +++ b/scripts/ci/cmake/ci-el7.cmake @@ -3,9 +3,9 @@ set(ENV{CC} gcc) set(ENV{CXX} g++) set(ENV{FC} gfortran) -set(ENV{CFLAGS} -Werror) -set(ENV{CXXFLAGS} -Werror) -set(ENV{FFLAGS} -Werror) +set(ENV{CFLAGS} "-Werror -Wall") +set(ENV{CXXFLAGS} "-Werror -Wall") +set(ENV{FFLAGS} "-Werror -Wall") set(dashboard_cache " ADIOS2_USE_BZip2:STRING=ON diff --git a/scripts/ci/cmake/ci-macos1014-xcode103-ninja.cmake b/scripts/ci/cmake/ci-macos1014-xcode103-ninja.cmake index b9f1eba04e..7e6857ba4c 100644 --- a/scripts/ci/cmake/ci-macos1014-xcode103-ninja.cmake +++ b/scripts/ci/cmake/ci-macos1014-xcode103-ninja.cmake @@ -2,6 +2,9 @@ set(ENV{CC} clang) set(ENV{CXX} clang++) set(ENV{FC} gfortran) +set(ENV{CFLAGS} "-Werror -Wall") +set(ENV{CXXFLAGS} "-Werror -Wall") +set(ENV{FFLAGS} "-Werror -Wall") set(dashboard_cache " ADIOS2_USE_Fortran:BOOL=ON diff --git a/scripts/ci/cmake/ci-macos1014-xcode103-openmpi-make.cmake b/scripts/ci/cmake/ci-macos1014-xcode103-openmpi-make.cmake index 51ba0bfc31..113ae25b1e 100644 --- a/scripts/ci/cmake/ci-macos1014-xcode103-openmpi-make.cmake +++ b/scripts/ci/cmake/ci-macos1014-xcode103-openmpi-make.cmake @@ -2,6 +2,9 @@ set(ENV{CC} clang) set(ENV{CXX} clang++) set(ENV{FC} gfortran) +set(ENV{CFLAGS} "-Werror -Wall") +set(ENV{CXXFLAGS} "-Werror -Wall") +set(ENV{FFLAGS} "-Werror -Wall") include(ProcessorCount) ProcessorCount(NCPUS) diff --git a/scripts/ci/cmake/ci-macos1015-xcode111-make.cmake b/scripts/ci/cmake/ci-macos1015-xcode111-make.cmake index c422af45a0..754ae327e3 100644 --- a/scripts/ci/cmake/ci-macos1015-xcode111-make.cmake +++ b/scripts/ci/cmake/ci-macos1015-xcode111-make.cmake @@ -2,6 +2,9 @@ set(ENV{CC} clang) set(ENV{CXX} clang++) set(ENV{FC} gfortran) +set(ENV{CFLAGS} "-Werror -Wall") +set(ENV{CXXFLAGS} "-Werror -Wall") +set(ENV{FFLAGS} "-Werror -Wall") set(dashboard_cache " ADIOS2_USE_Fortran:BOOL=ON diff --git a/scripts/ci/cmake/ci-macos1015-xcode111-openmpi-ninja.cmake b/scripts/ci/cmake/ci-macos1015-xcode111-openmpi-ninja.cmake index af2ffa94c8..f24ab25277 100644 --- a/scripts/ci/cmake/ci-macos1015-xcode111-openmpi-ninja.cmake +++ b/scripts/ci/cmake/ci-macos1015-xcode111-openmpi-ninja.cmake @@ -2,6 +2,9 @@ set(ENV{CC} clang) set(ENV{CXX} clang++) set(ENV{FC} gfortran) +set(ENV{CFLAGS} "-Werror -Wall") +set(ENV{CXXFLAGS} "-Werror -Wall") +set(ENV{FFLAGS} "-Werror -Wall") include(ProcessorCount) ProcessorCount(NCPUS) diff --git a/scripts/ci/cmake/ci-ubuntu1804-spack.cmake b/scripts/ci/cmake/ci-ubuntu1804-spack.cmake index 2b833980d4..a559b4bad2 100644 --- a/scripts/ci/cmake/ci-ubuntu1804-spack.cmake +++ b/scripts/ci/cmake/ci-ubuntu1804-spack.cmake @@ -7,9 +7,9 @@ math(EXPR N2CPUS "${NCPUS}*2") set(ENV{CC} gcc) set(ENV{CXX} g++) set(ENV{FC} gfortran) -set(ENV{CFLAGS} "-Werror -Wno-error=builtin-declaration-mismatch") -set(ENV{CXXFLAGS} "-Werror -Wno-error=builtin-declaration-mismatch") -set(ENV{FFLAGS} "-Werror -Wno-error=builtin-declaration-mismatch") +set(ENV{CFLAGS} "-Werror -Wall -Wno-error=builtin-declaration-mismatch") +set(ENV{CXXFLAGS} "-Werror -Wall -Wno-error=builtin-declaration-mismatch") +set(ENV{FFLAGS} "-Werror -Wall -Wno-error=builtin-declaration-mismatch") set(dashboard_cache " ADIOS2_USE_BZip2:BOOL=ON diff --git a/source/adios2/engine/dataman/DataManMonitor.h b/source/adios2/engine/dataman/DataManMonitor.h index e8d732e8a6..9a95cf496d 100644 --- a/source/adios2/engine/dataman/DataManMonitor.h +++ b/source/adios2/engine/dataman/DataManMonitor.h @@ -76,7 +76,6 @@ class DataManMonitor bool m_WriterThreading = false; bool m_Verbose = true; - bool m_JsonOutput = true; }; } // end namespace engine diff --git a/source/adios2/engine/sst/SstReader.cpp b/source/adios2/engine/sst/SstReader.cpp index cb858b2f84..03158153e7 100644 --- a/source/adios2/engine/sst/SstReader.cpp +++ b/source/adios2/engine/sst/SstReader.cpp @@ -486,7 +486,7 @@ void SstReader::Init() size_t *Start = NULL; \ size_t *Count = NULL; \ size_t DimCount = 0; \ - int NeedSync; \ + int NeedSync = 0; \ \ if (variable.m_SelectionType == \ adios2::SelectionType::BoundingBox) \ diff --git a/source/adios2/helper/adiosMemory.inl b/source/adios2/helper/adiosMemory.inl index 95a2889be1..41217f5af0 100644 --- a/source/adios2/helper/adiosMemory.inl +++ b/source/adios2/helper/adiosMemory.inl @@ -623,7 +623,7 @@ void Resize(std::vector &vec, const size_t dataSize, const std::string hint, // functions) and copies to the output buffer in blocks. the memory address // calculation complexity for copying each block is minimized to O(1), which is // independent of the number of dimensions. -static void NdCopyRecurDFSeqPadding(size_t curDim, const char *&inOvlpBase, +static inline void NdCopyRecurDFSeqPadding(size_t curDim, const char *&inOvlpBase, char *&outOvlpBase, Dims &inOvlpGapSize, Dims &outOvlpGapSize, Dims &ovlpCount, size_t &minContDim, size_t &blockSize) @@ -666,7 +666,7 @@ static void NdCopyRecurDFSeqPadding(size_t curDim, const char *&inOvlpBase, // each element is minimized to average O(1), which is independent of // the number of dimensions. -static void +static inline void NdCopyRecurDFSeqPaddingRevEndian(size_t curDim, const char *&inOvlpBase, char *&outOvlpBase, Dims &inOvlpGapSize, Dims &outOvlpGapSize, Dims &ovlpCount, @@ -707,7 +707,7 @@ NdCopyRecurDFSeqPaddingRevEndian(size_t curDim, const char *&inOvlpBase, // used for buffer of Column major // the memory address calculation complexity for copying each element is // minimized to average O(1), which is independent of the number of dimensions. -static void NdCopyRecurDFNonSeqDynamic(size_t curDim, const char *inBase, +static inline void NdCopyRecurDFNonSeqDynamic(size_t curDim, const char *inBase, char *outBase, Dims &inRltvOvlpSPos, Dims &outRltvOvlpSPos, Dims &inStride, Dims &outStride, Dims &ovlpCount, @@ -737,7 +737,7 @@ static void NdCopyRecurDFNonSeqDynamic(size_t curDim, const char *inBase, // The memory address calculation complexity for copying each element is // minimized to average O(1), which is independent of the number of dimensions. -static void NdCopyRecurDFNonSeqDynamicRevEndian( +static inline void NdCopyRecurDFNonSeqDynamicRevEndian( size_t curDim, const char *inBase, char *outBase, Dims &inRltvOvlpSPos, Dims &outRltvOvlpSPos, Dims &inStride, Dims &outStride, Dims &ovlpCount, size_t elmSize) @@ -763,7 +763,7 @@ static void NdCopyRecurDFNonSeqDynamicRevEndian( } } -static void NdCopyIterDFSeqPadding(const char *&inOvlpBase, char *&outOvlpBase, +static inline void NdCopyIterDFSeqPadding(const char *&inOvlpBase, char *&outOvlpBase, Dims &inOvlpGapSize, Dims &outOvlpGapSize, Dims &ovlpCount, size_t minContDim, size_t blockSize) @@ -794,7 +794,7 @@ static void NdCopyIterDFSeqPadding(const char *&inOvlpBase, char *&outOvlpBase, } } -static void NdCopyIterDFSeqPaddingRevEndian( +static inline void NdCopyIterDFSeqPaddingRevEndian( const char *&inOvlpBase, char *&outOvlpBase, Dims &inOvlpGapSize, Dims &outOvlpGapSize, Dims &ovlpCount, size_t minContDim, size_t blockSize, size_t elmSize, size_t numElmsPerBlock) @@ -830,7 +830,7 @@ static void NdCopyIterDFSeqPaddingRevEndian( } while (pos[curDim] == ovlpCount[curDim]); } } -static void NdCopyIterDFDynamic(const char *inBase, char *outBase, +static inline void NdCopyIterDFDynamic(const char *inBase, char *outBase, Dims &inRltvOvlpSPos, Dims &outRltvOvlpSPos, Dims &inStride, Dims &outStride, Dims &ovlpCount, size_t elmSize) @@ -867,7 +867,7 @@ static void NdCopyIterDFDynamic(const char *inBase, char *outBase, } } -static void NdCopyIterDFDynamicRevEndian(const char *inBase, char *outBase, +static inline void NdCopyIterDFDynamicRevEndian(const char *inBase, char *outBase, Dims &inRltvOvlpSPos, Dims &outRltvOvlpSPos, Dims &inStride, Dims &outStride, Dims &ovlpCount, diff --git a/source/adios2/helper/adiosType.inl b/source/adios2/helper/adiosType.inl index 23eb7d02f8..a5ea08612e 100644 --- a/source/adios2/helper/adiosType.inl +++ b/source/adios2/helper/adiosType.inl @@ -179,7 +179,7 @@ inline std::string VectorToCSV(const std::vector &input) noexcept } std::ostringstream valueSS; - for (const auto value : input) + for (const auto& value : input) { valueSS << "\"" << value << "\", "; } @@ -200,7 +200,7 @@ inline std::string VectorToCSV(const std::vector &input) noexcept } \ \ std::ostringstream valueSS; \ - for (const auto value : input) \ + for (const auto& value : input) \ { \ const int valueInt = static_cast(value); \ valueSS << valueInt << ", "; \ @@ -223,7 +223,7 @@ inline std::string VectorToCSV(const std::vector &input) noexcept } std::ostringstream valueSS; - for (const auto value : input) + for (const auto& value : input) { valueSS << value << ", "; } diff --git a/source/adios2/toolkit/format/bp/BPBase.cpp b/source/adios2/toolkit/format/bp/BPBase.cpp index 0ec23a9a02..e41011c7e0 100644 --- a/source/adios2/toolkit/format/bp/BPBase.cpp +++ b/source/adios2/toolkit/format/bp/BPBase.cpp @@ -393,7 +393,7 @@ BPBase::GetTransportIDs(const std::vector &transportsTypes) const std::vector transportsIDs; transportsIDs.reserve(transportsTypes.size()); - for (const std::string transportType : transportsTypes) + for (const std::string& transportType : transportsTypes) { transportsIDs.push_back(lf_GetTransportID(transportType)); } diff --git a/source/adios2/toolkit/format/dataman/DataManSerializer.tcc b/source/adios2/toolkit/format/dataman/DataManSerializer.tcc index 1a3e3217aa..3fb88ff2a8 100644 --- a/source/adios2/toolkit/format/dataman/DataManSerializer.tcc +++ b/source/adios2/toolkit/format/dataman/DataManSerializer.tcc @@ -458,7 +458,7 @@ int DataManSerializer::GetData(T *outputData, const std::string &varName, } if (j.shape.empty() or (j.shape.size() == 1 and j.shape[0] == 1)) { - std::memcpy(outputData, input_data, sizeof(T)); + std::memcpy(reinterpret_cast(outputData), input_data, sizeof(T)); } } } diff --git a/source/adios2/toolkit/profiling/taustubs/tautimer.cpp b/source/adios2/toolkit/profiling/taustubs/tautimer.cpp index fb0d669edb..c076b546ca 100644 --- a/source/adios2/toolkit/profiling/taustubs/tautimer.cpp +++ b/source/adios2/toolkit/profiling/taustubs/tautimer.cpp @@ -93,7 +93,7 @@ void (*my_Tau_destructor_trigger)(void) = NULL; static void initialize_library(void) { // initialize the library when it is loaded - static taustubs::TauTimer &tt = taustubs::TauTimer::get(); + taustubs::TauTimer::get(); } void open_preload_libraries(void) diff --git a/source/adios2/toolkit/sst/dp/rdma_dp.c b/source/adios2/toolkit/sst/dp/rdma_dp.c index 9459a443ed..fda75b5cf1 100644 --- a/source/adios2/toolkit/sst/dp/rdma_dp.c +++ b/source/adios2/toolkit/sst/dp/rdma_dp.c @@ -1140,7 +1140,7 @@ static void *RdmaReadRemoteMemory(CP_Services Svcs, DP_RS_Stream Stream_v, size_t Length, void *Buffer, void *DP_TimestepInfo) { - RdmaCompletionHandle ret; + RdmaCompletionHandle ret = {0}; Rdma_RS_Stream RS_Stream = (Rdma_RS_Stream)Stream_v; RdmaBufferHandle Info = (RdmaBufferHandle)DP_TimestepInfo; RdmaStepLogEntry StepLog; @@ -1540,9 +1540,10 @@ static void RdmaDestroyReader(CP_Services Svcs, DP_RS_Stream RS_Stream_v) static void RdmaDestroyWriterPerReader(CP_Services Svcs, DP_WSR_Stream WSR_Stream_v) { - Rdma_WSR_Stream WSR_Stream = (Rdma_WSR_Stream)WSR_Stream_v; + Rdma_WSR_Stream WSR_Stream = {0}; + memcpy(&WSR_Stream, &WSR_Stream_v, sizeof(Rdma_WSR_Stream)); Rdma_WS_Stream WS_Stream = WSR_Stream->WS_Stream; - RdmaWriterContactInfo WriterContactInfo; + RdmaWriterContactInfo WriterContactInfo = {0}; pthread_mutex_lock(&wsr_mutex); for (int i = 0; i < WS_Stream->ReaderCount; i++) diff --git a/source/adios2/toolkit/zmq/zmqreqrep/ZmqReqRep.h b/source/adios2/toolkit/zmq/zmqreqrep/ZmqReqRep.h index 6afa8d266f..56cae2b2aa 100644 --- a/source/adios2/toolkit/zmq/zmqreqrep/ZmqReqRep.h +++ b/source/adios2/toolkit/zmq/zmqreqrep/ZmqReqRep.h @@ -45,7 +45,6 @@ class ZmqReqRep void SendReply(const void *reply, const size_t size); private: - int m_Verbosity = 0; int m_Timeout; std::vector m_ReceiverBuffer; diff --git a/source/h5vol/H5VolError.h b/source/h5vol/H5VolError.h index 1437bac82a..a924c6a58f 100644 --- a/source/h5vol/H5VolError.h +++ b/source/h5vol/H5VolError.h @@ -10,8 +10,8 @@ void *safe_calloc(size_t n, size_t s, unsigned long line); void *safe_malloc(size_t n, unsigned long line); #define SAFE_MALLOC(n) safe_malloc(n, __LINE__) -void safe_free(void *p); -#define SAFE_FREE(ptr) safe_free(ptr) +void safe_free(void **p); +#define SAFE_FREE(ptr) safe_free(&ptr) void *safe_ralloc(void *ptr, size_t newsize, unsigned long line); #define SAFE_REALLOC(ptr, newsize) safe_ralloc(ptr, newsize, __LINE__) diff --git a/source/h5vol/H5VolUtil.c b/source/h5vol/H5VolUtil.c index 6f44a18c70..b58d0d6c1a 100644 --- a/source/h5vol/H5VolUtil.c +++ b/source/h5vol/H5VolUtil.c @@ -35,7 +35,7 @@ void *safe_malloc(size_t n, unsigned long line) return p; } -void safe_free(void *p) +void safe_free(void **p) { if (p) { diff --git a/testing/adios2/engine/bp/TestBPWriteAppendReadADIOS2.cpp b/testing/adios2/engine/bp/TestBPWriteAppendReadADIOS2.cpp index ef7288f05a..4d16ddf9e6 100644 --- a/testing/adios2/engine/bp/TestBPWriteAppendReadADIOS2.cpp +++ b/testing/adios2/engine/bp/TestBPWriteAppendReadADIOS2.cpp @@ -15,6 +15,20 @@ #include "../SmallTestData.h" +#if defined(_MSC_VER) +#pragma warning( push ) +//#pragma warning( disable : 4101) +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#pragma GCC diagnostic ignored "-Wunused-variable" + +#elif defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wstrict-aliasing" +#pragma clang diagnostic ignored "-Wunused-variable" +#endif + std::string engineName; // comes from command line class BPWriteAppendReadTestADIOS2 : public ::testing::Test @@ -733,3 +747,12 @@ int main(int argc, char **argv) return result; } + +#if defined(_MSC_VER) +#pragma warning( pop ) +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#elif defined(__clang__) +#pragma clang diagnostic pop +#endif + diff --git a/testing/adios2/engine/bp/TestBPWriteReadAsStreamADIOS2.cpp b/testing/adios2/engine/bp/TestBPWriteReadAsStreamADIOS2.cpp index a0b868afcf..4ee9aef524 100644 --- a/testing/adios2/engine/bp/TestBPWriteReadAsStreamADIOS2.cpp +++ b/testing/adios2/engine/bp/TestBPWriteReadAsStreamADIOS2.cpp @@ -14,6 +14,18 @@ #include "../SmallTestData.h" +#if defined(_MSC_VER) +#pragma warning( push ) +//#pragma warning( disable : 4101) +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" + +#elif defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" +#endif + std::string engineName; // comes from command line class BPWriteReadAsStreamTestADIOS2 : public ::testing::Test @@ -1070,3 +1082,12 @@ int main(int argc, char **argv) return result; } + +#if defined(_MSC_VER) +#pragma warning( pop ) +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#elif defined(__clang__) +#pragma clang diagnostic pop +#endif + diff --git a/testing/adios2/engine/bp/TestBPWriteReadAttributesMultirank.cpp b/testing/adios2/engine/bp/TestBPWriteReadAttributesMultirank.cpp index baddebc521..c68f58dbaf 100644 --- a/testing/adios2/engine/bp/TestBPWriteReadAttributesMultirank.cpp +++ b/testing/adios2/engine/bp/TestBPWriteReadAttributesMultirank.cpp @@ -17,6 +17,19 @@ #include +#if defined(_MSC_VER) +#pragma warning( push ) +//#pragma warning( disable : 4101) +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" + +#elif defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" +#endif + + std::string engineName; // comes from command line class BPWriteReadAttributeTestMultirank : public ::testing::Test @@ -137,3 +150,12 @@ int main(int argc, char **argv) return result; } + +#if defined(_MSC_VER) +#pragma warning( pop ) +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#elif defined(__clang__) +#pragma clang diagnostic pop +#endif + diff --git a/testing/adios2/engine/bp/TestBPWriteReadLocalVariables.cpp b/testing/adios2/engine/bp/TestBPWriteReadLocalVariables.cpp index 1feaeb246e..b18e47e4ea 100644 --- a/testing/adios2/engine/bp/TestBPWriteReadLocalVariables.cpp +++ b/testing/adios2/engine/bp/TestBPWriteReadLocalVariables.cpp @@ -15,6 +15,18 @@ #include "../SmallTestData.h" +#if defined(_MSC_VER) +#pragma warning( push ) +//#pragma warning( disable : 4101) +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" + +#elif defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" +#endif + std::string engineName; // comes from command line class BPWriteReadLocalVariables : public ::testing::Test @@ -1948,3 +1960,13 @@ int main(int argc, char **argv) return result; } + + +#if defined(_MSC_VER) +#pragma warning( pop ) +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#elif defined(__clang__) +#pragma clang diagnostic pop +#endif + diff --git a/testing/adios2/engine/bp/TestBPWriteReadVariableSpan.cpp b/testing/adios2/engine/bp/TestBPWriteReadVariableSpan.cpp index f59d273186..d2c6b2c063 100644 --- a/testing/adios2/engine/bp/TestBPWriteReadVariableSpan.cpp +++ b/testing/adios2/engine/bp/TestBPWriteReadVariableSpan.cpp @@ -14,6 +14,18 @@ #include "../SmallTestData.h" +#if defined(_MSC_VER) +#pragma warning( push ) +//#pragma warning( disable : 4101) +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" + +#elif defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" +#endif + std::string engineName; // comes from command line class BPWriteReadSpan : public ::testing::Test @@ -1535,3 +1547,12 @@ int main(int argc, char **argv) return result; } + +#if defined(_MSC_VER) +#pragma warning( pop ) +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#elif defined(__clang__) +#pragma clang diagnostic pop +#endif + diff --git a/testing/adios2/engine/bp/operations/TestBPWriteReadZfpConfig.cpp b/testing/adios2/engine/bp/operations/TestBPWriteReadZfpConfig.cpp index 5adcc94a25..303481a180 100644 --- a/testing/adios2/engine/bp/operations/TestBPWriteReadZfpConfig.cpp +++ b/testing/adios2/engine/bp/operations/TestBPWriteReadZfpConfig.cpp @@ -13,6 +13,18 @@ #include +#if defined(_MSC_VER) +#pragma warning( push ) +//#pragma warning( disable : 4101) +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" + +#elif defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" +#endif + #define str_helper(X) #X #define mystr(X) str_helper(X) @@ -900,3 +912,11 @@ int main(int argc, char **argv) return result; } + +#if defined(_MSC_VER) +#pragma warning( pop ) +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#elif defined(__clang__) +#pragma clang diagnostic pop +#endif diff --git a/testing/adios2/engine/skeleton/TestSkeletonReader.cpp b/testing/adios2/engine/skeleton/TestSkeletonReader.cpp index cdf30bac5a..05136746a9 100644 --- a/testing/adios2/engine/skeleton/TestSkeletonReader.cpp +++ b/testing/adios2/engine/skeleton/TestSkeletonReader.cpp @@ -113,9 +113,11 @@ int main(int argc, char *argv[]) adios2::Variable varArray = io.DefineVariable( "myArray", {gndx}, {gndx / (size_t)nproc}, {gndx / (size_t)nproc}); + (void)varArray; adios2::Variable varSyncString = io.DefineVariable("mySyncString"); + (void)varSyncString; } else { diff --git a/testing/adios2/engine/staging-common/ParseArgs.h b/testing/adios2/engine/staging-common/ParseArgs.h index 8f606b2613..d2c1c31605 100644 --- a/testing/adios2/engine/staging-common/ParseArgs.h +++ b/testing/adios2/engine/staging-common/ParseArgs.h @@ -76,7 +76,7 @@ static adios2::Params ParseEngineParams(std::string Input) return Ret; } -static void ParseArgs(int argc, char **argv) +void ParseArgs(int argc, char **argv) { int bare_arg = 0; while (argc > 1) diff --git a/testing/adios2/interface/TestADIOSDefineAttribute.cpp b/testing/adios2/interface/TestADIOSDefineAttribute.cpp index 4ae737af9a..eeb4f30f5f 100644 --- a/testing/adios2/interface/TestADIOSDefineAttribute.cpp +++ b/testing/adios2/interface/TestADIOSDefineAttribute.cpp @@ -749,7 +749,7 @@ TEST_F(ADIOSDefineAttributeTest, VariableException) "myVar1", separator), std::invalid_argument); - auto var = io.DefineVariable("myVar1"); + io.DefineVariable("myVar1"); EXPECT_NO_THROW( io.DefineAttribute("Hello Value", "Value", "myVar1")); diff --git a/testing/adios2/interface/TestADIOSInterfaceWrite.cpp b/testing/adios2/interface/TestADIOSInterfaceWrite.cpp index 631f592393..99c6180217 100644 --- a/testing/adios2/interface/TestADIOSInterfaceWrite.cpp +++ b/testing/adios2/interface/TestADIOSInterfaceWrite.cpp @@ -7,6 +7,19 @@ #include +#if defined(_MSC_VER) +#pragma warning( push ) +//#pragma warning( disable : 4101) +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" + +#elif defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" +#endif + + class ADIOSInterfaceWriteTest : public ::testing::Test { public: @@ -634,3 +647,11 @@ int main(int argc, char **argv) return result; } + +#if defined(_MSC_VER) +#pragma warning( pop ) +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#elif defined(__clang__) +#pragma clang diagnostic pop +#endif diff --git a/testing/adios2/performance/manyvars/TestManyVars.cpp b/testing/adios2/performance/manyvars/TestManyVars.cpp index cf8c1e22c3..93e0d4bdf2 100644 --- a/testing/adios2/performance/manyvars/TestManyVars.cpp +++ b/testing/adios2/performance/manyvars/TestManyVars.cpp @@ -187,7 +187,7 @@ class TestManyVars : public ::testing::TestWithParam digit++; } - char fmt[16]; + char fmt[32]; sprintf(fmt, "v%%%d.%dd", digit, digit); for (size_t i = 0; i < NVARS; i++) { diff --git a/testing/adios2/xml/TestXMLConfig.cpp b/testing/adios2/xml/TestXMLConfig.cpp index a6f5b70ed8..01e1ca2195 100644 --- a/testing/adios2/xml/TestXMLConfig.cpp +++ b/testing/adios2/xml/TestXMLConfig.cpp @@ -7,6 +7,18 @@ #include +#if defined(_MSC_VER) +#pragma warning( push ) +//#pragma warning( disable : 4101) +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" + +#elif defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" +#endif + #define str_helper(X) #X #define str(X) str_helper(X) @@ -143,3 +155,11 @@ int main(int argc, char **argv) return result; } + +#if defined(_MSC_VER) +#pragma warning( pop ) +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#elif defined(__clang__) +#pragma clang diagnostic pop +#endif diff --git a/testing/adios2/yaml/TestYAMLConfig.cpp b/testing/adios2/yaml/TestYAMLConfig.cpp index 1473b33e87..9f0bd27d06 100644 --- a/testing/adios2/yaml/TestYAMLConfig.cpp +++ b/testing/adios2/yaml/TestYAMLConfig.cpp @@ -7,6 +7,18 @@ #include +#if defined(_MSC_VER) +#pragma warning( push ) +//#pragma warning( disable : 4101) +#elif defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-variable" + +#elif defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-variable" +#endif + #define str_helper(X) #X #define str(X) str_helper(X) @@ -113,3 +125,12 @@ int main(int argc, char **argv) return result; } + + +#if defined(_MSC_VER) +#pragma warning( pop ) +#elif defined(__GNUC__) +#pragma GCC diagnostic pop +#elif defined(__clang__) +#pragma clang diagnostic pop +#endif