Skip to content
Snippets Groups Projects
Commit 240c9a7f authored by Christoph Hasse's avatar Christoph Hasse Committed by Marco Clemencic
Browse files

Minor fixes for Clang 10 build, adapt BinaryTagUtils to allow compiler version >10

parent d1dc2b0e
No related branches found
No related tags found
No related merge requests found
......@@ -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" )
......
......@@ -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 {
......
......@@ -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 );
......
......@@ -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
}
......
......@@ -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 ) {
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment