From: abn Date: Fri, 18 Sep 2020 18:46:36 +0000 (+0200) Subject: Fix clang compilation (template instanciations) X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=096829d01861733127594be482871ca77ed7024b;p=tools%2Fmedcoupling.git Fix clang compilation (template instanciations) + minor other fixes + CMakeLists: adding (in comment) a useful set of warnings. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b22d4d00..89debb67f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11 FATAL_ERROR) #INCLUDE(CMakeDependentOption) PROJECT(MEDCoupling C CXX) + # Versioning # =========== # Project name, upper case @@ -45,6 +46,30 @@ ENDIF() # ============== INCLUDE(SalomeSetupPlatform) +# [ABN]: use the below for aggressive code quality check: +#if( EXISTS "aaaa") +# add_definitions(-Weverything) +# add_definitions(-Wno-inconsistent-missing-override) +# add_definitions(-Wno-c++98-compat -Wno-c++98-compat-pedantic) +# add_definitions(-Wno-sign-conversion) +# add_definitions(-Wno-switch-enum) +# +# add_definitions(-Wno-documentation-unknown-command) # \image in Doxygen +# add_definitions(-Wno-gnu-statement-expression) # assert(...) +# +# add_definitions(-Wno-reserved-id-macro -Wno-padded -Wno-weak-vtables -Wdouble-promotion -Wno-comma -Wno-unused-parameter) +# add_definitions(-Wno-unreachable-code-break -Wno-old-style-cast -Wno-deprecated -Wno-double-promotion) +# add_definitions(-Wno-exit-time-destructors -Wno-global-constructors -Wno-missing-prototypes) +# add_definitions(-Wno-covered-switch-default -Wno-weak-template-vtables -Wno-undefined-func-template -Wno-used-but-marked-unused) +# add_definitions(-Wno-unreachable-code-return -Wno-missing-noreturn -Wno-unused-member-function -Wno-header-hygiene) +# add_definitions(-Wno-ignored-qualifiers) # because of MED-file +# add_definitions(-Wno-unused-function -Wno-unused-macros) +# add_definitions(-Wno-missing-field-initializers) +# add_definitions(-Wno-shadow) # SWIG generates a lot of those ... +# +# add_definitions(-Wno-float-equal) # OUCH +#endif() + # # User options # ============ @@ -141,6 +166,9 @@ ENDIF(MEDCOUPLING_BUILD_TESTS) IF(MEDCOUPLING_USE_MPI) FIND_PACKAGE(SalomeMPI REQUIRED) ADD_DEFINITIONS("-DHAVE_MPI") + +salome_accumulate_environment(LD_LIBRARY_PATH "/usr/lib64/mpich/lib") + SALOME_ADD_MPI_TO_HDF5() IF(MEDCOUPLING_PARTITIONER_PARMETIS) FIND_PACKAGE(SalomeParMetis) diff --git a/src/INTERP_KERNEL/Log.hxx b/src/INTERP_KERNEL/Log.hxx index 568ffca3d..c766f5aa9 100644 --- a/src/INTERP_KERNEL/Log.hxx +++ b/src/INTERP_KERNEL/Log.hxx @@ -21,7 +21,6 @@ #define _LOG_H_ /** - * \file Log.hxx * \brief Simple pre-processor logging utility. * * Replaces LOG( lvl, x ) with "if(lvl <= LOG_LEVEL) std::cout << x << std::endl" when logging is active diff --git a/src/INTERP_KERNEL/TransformedTriangle.hxx b/src/INTERP_KERNEL/TransformedTriangle.hxx index c2a017c2a..368743d35 100644 --- a/src/INTERP_KERNEL/TransformedTriangle.hxx +++ b/src/INTERP_KERNEL/TransformedTriangle.hxx @@ -60,8 +60,7 @@ namespace INTERP_KERNEL * */ - /** \file TransformedTriangle.hxx - * + /** * OVERVIEW of how the class works : (details can be found in the documentation of each method) * * Constructor : diff --git a/src/INTERP_KERNEL/TransformedTriangleMath.cxx b/src/INTERP_KERNEL/TransformedTriangleMath.cxx index 220698126..d54c0ca5c 100644 --- a/src/INTERP_KERNEL/TransformedTriangleMath.cxx +++ b/src/INTERP_KERNEL/TransformedTriangleMath.cxx @@ -182,13 +182,13 @@ namespace INTERP_KERNEL LOG(2, "for seg " << seg << " consistency " << term1 + term2 + term3 ); LOG(2, "term1 :" << term1 << " term2 :" << term2 << " term3: " << term3 ); - + const int num_zero = (term1 == 0.0 ? 1 : 0) + (term2 == 0.0 ? 1 : 0) + (term3 == 0.0 ? 1 : 0); const int num_neg = (term1 < 0.0 ? 1 : 0) + (term2 < 0.0 ? 1 : 0) + (term3 < 0.0 ? 1 : 0); const int num_pos = (term1 > 0.0 ? 1 : 0) + (term2 > 0.0 ? 1 : 0) + (term3 > 0.0 ? 1 : 0); - + assert( num_zero + num_neg + num_pos == 3 ); - + // calculated geometry is inconsistent if we have one of the following cases // * one term zero and the other two of the same sign // * two terms zero diff --git a/src/INTERP_KERNELTest/PerfTest.cxx b/src/INTERP_KERNELTest/PerfTest.cxx index 1a7f7c9b5..5c191a2c1 100644 --- a/src/INTERP_KERNELTest/PerfTest.cxx +++ b/src/INTERP_KERNELTest/PerfTest.cxx @@ -30,7 +30,6 @@ #include /** - * \file PerfTest.cxx * Test program which takes two meshes and calculates their intersection matrix. * * USAGE : PerfTest mesh1 mesh2 diff --git a/src/ParaMEDMEM/ParaDataArray.cxx b/src/ParaMEDMEM/ParaDataArray.cxx index 2f990286f..23ca1dd50 100644 --- a/src/ParaMEDMEM/ParaDataArray.cxx +++ b/src/ParaMEDMEM/ParaDataArray.cxx @@ -22,10 +22,10 @@ using namespace MEDCoupling; -template class ParaDataArrayTemplate; -template class ParaDataArrayTemplate; -template class ParaDataArrayDiscrete; -template class ParaDataArrayDiscrete; +template class MEDCoupling::ParaDataArrayTemplate; +template class MEDCoupling::ParaDataArrayTemplate; +template class MEDCoupling::ParaDataArrayDiscrete; +template class MEDCoupling::ParaDataArrayDiscrete; ParaDataArrayInt32 *ParaDataArrayInt32::New(DataArrayInt32 *seqDa) { diff --git a/src/ParaMEDMEMTest/test_AllToAllvTimeDEC.cxx b/src/ParaMEDMEMTest/test_AllToAllvTimeDEC.cxx index ad4f4d2e6..4af2ead74 100644 --- a/src/ParaMEDMEMTest/test_AllToAllvTimeDEC.cxx +++ b/src/ParaMEDMEMTest/test_AllToAllvTimeDEC.cxx @@ -174,7 +174,7 @@ void MPIAccessDECTest::test_AllToAllvTimeDEC( bool Asynchronous , bool UseMPINat // MyMPIAccessDEC->NextTime( nextdeltatime ) ; } MyMPIAccessDEC->setTime( timeLoc , nextdeltatime ) ; - debugStream << "test_AllToAllvTimeDEC" << myrank << "=====TIME " << time << "=====DELTATIME " + debugStream << "test_AllToAllvTimeDEC" << myrank << "=====TIME " << timeLoc << "=====DELTATIME " << nextdeltatime << "=====MAXTIME " << maxtime << " ======" << endl ; int * sendbuf = new int[datamsglength*size] ; // int * sendbuf = (int *) malloc(sizeof(int)*datamsglength*size) ;