diff --git a/GaudiAlg/GaudiAlg/FunctionalDetails.h b/GaudiAlg/GaudiAlg/FunctionalDetails.h index 81ad2ff401cfffa97a7f048134074654b8d783d1..c0bd4e6c05849a1f5c3e3098b5f71d20db5990e1 100644 --- a/GaudiAlg/GaudiAlg/FunctionalDetails.h +++ b/GaudiAlg/GaudiAlg/FunctionalDetails.h @@ -35,7 +35,7 @@ namespace ranges::views { } #endif -#if defined( __clang__ ) && ( __clang_major__ < 9 ) || defined( __APPLE__ ) && ( __clang_major__ < 12 ) +#if defined( __clang__ ) && ( __clang_major__ < 11 ) || defined( __APPLE__ ) && ( __clang_major__ < 12 ) # define GF_SUPPRESS_SPURIOUS_CLANG_WARNING_BEGIN \ _Pragma( "clang diagnostic push" ) _Pragma( "clang diagnostic ignored \"-Wunused-lambda-capture\"" ) # define GF_SUPPRESS_SPURIOUS_CLANG_WARNING_END _Pragma( "clang diagnostic pop" ) diff --git a/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp b/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp index a39ca73de03967cfd2c7734ba93b711edc730171..cfe1b95524e76df0e48ec7c125466c1c33302a8d 100644 --- a/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp +++ b/GaudiCoreSvc/src/ApplicationMgr/ApplicationMgr.cpp @@ -1013,7 +1013,7 @@ StatusCode ApplicationMgr::decodeDllNameList() { std::vector<std::string> newList; std::map<std::string, unsigned int> dllInList, duplicateList; { - for ( const auto it : m_dllNameList ) { + for ( const auto& it : m_dllNameList ) { if ( 0 == dllInList[it] ) { newList.push_back( it ); // first instance of this module } else { diff --git a/GaudiKernel/src/Lib/Bootstrap.cpp b/GaudiKernel/src/Lib/Bootstrap.cpp index 41ba27e3998dd3cc362885297f8791f52385c6d3..a0f5ef63ba8d018e907d14d757873783fa26a892 100644 --- a/GaudiKernel/src/Lib/Bootstrap.cpp +++ b/GaudiKernel/src/Lib/Bootstrap.cpp @@ -246,7 +246,10 @@ bool PyHelper( setProperty )( IInterface* p, char* name, char* value ) { } const char* PyHelper( getProperty )( IInterface* p, char* name ) { auto prop = SmartIF<IProperty>( p ); - return prop ? prop->getProperty( name ).toString().c_str() : nullptr; + if ( !prop ) return nullptr; + static std::string value; + value = prop->getProperty( name ).toString(); + return value.c_str(); } bool PyHelper( configureApp )( IInterface* app ) { auto ui = SmartIF<IAppMgrUI>( app ); diff --git a/GaudiKernel/tests/src/test_StatusCode_fail.cxx b/GaudiKernel/tests/src/test_StatusCode_fail.cxx index 565c31e206ce5a1d600a0bdcc7daaecaba6a88ab..2a3eea9b10944b5e546b7f83a83633e66c32e910 100644 --- a/GaudiKernel/tests/src/test_StatusCode_fail.cxx +++ b/GaudiKernel/tests/src/test_StatusCode_fail.cxx @@ -12,9 +12,10 @@ int main() { { - StatusCode sc = 42; // FAIL01: no implicit conversion from int - int i = sc; // FAIL02: no implicit conversion to int - bool b = sc; // FAIL03: no implicit conversion to bool + StatusCode sc{}; + sc = 42; // FAIL01: no implicit conversion from int + int i = sc; // FAIL02: no implicit conversion to int + bool b = sc; // FAIL03: no implicit conversion to bool (void)i; (void)b; // silence "unused" compiler warnings } diff --git a/GaudiSvc/src/MetaDataSvc/MetaDataSvc.cpp b/GaudiSvc/src/MetaDataSvc/MetaDataSvc.cpp index 8b6cb103547a6ebf025544cd8879098943f438ff..d8e061178bc58dc761b35ef362dc84685c44d508 100644 --- a/GaudiSvc/src/MetaDataSvc/MetaDataSvc.cpp +++ b/GaudiSvc/src/MetaDataSvc/MetaDataSvc.cpp @@ -69,7 +69,7 @@ StatusCode MetaDataSvc::collectData() { { auto joSvc = service<IJobOptionsSvc>( "JobOptionsSvc" ); if ( !joSvc.isValid() ) return StatusCode::FAILURE; - for ( const auto c : joSvc->getClients() ) { + for ( const auto& c : joSvc->getClients() ) { // get options for this client const auto props = joSvc->getProperties( c ); if ( props ) { diff --git a/cmake/BinaryTagUtils.cmake b/cmake/BinaryTagUtils.cmake index 251fa36be8d62173d4af83a67073b4fedc0d9ec7..26b24187ade4c62469de29cbec01760b5b5b4ed0 100644 --- a/cmake/BinaryTagUtils.cmake +++ b/cmake/BinaryTagUtils.cmake @@ -119,8 +119,8 @@ macro(parse_binary_tag) set(${_variable}_COMP_VERSION ${CMAKE_MATCH_2}) if(NOT ${_variable}_COMP_NAME STREQUAL "icc") # all known compilers except icc have one digit per version level - # so we map "XY" to "X.Y" - string(REGEX MATCHALL "[0-9]" _out "${${_variable}_COMP_VERSION}") + # or is less than 20 so we map "1X" to "1X" and "XY" to "X.Y" + string(REGEX MATCHALL "(1[0-9]|[0-9])" _out "${${_variable}_COMP_VERSION}") set(${_variable}_COMP_VERSION) list(GET _out 0 ${_variable}_COMP_VERSION) list(REMOVE_AT _out 0)