From 85ccbe5c56a9cd16a764d94e5a456c1262a54d8b Mon Sep 17 00:00:00 2001 From: Tomasz Swierczek Date: Fri, 10 Jan 2020 10:11:23 +0100 Subject: [PATCH] Fix build for gcc 9 Change-Id: I2d5eb654f7e7ab6fa9145d902542b5fe1984da64 --- packaging/key-manager.spec | 4 ++++ src/manager/common/openssl-error-handler.cpp | 3 ++- src/manager/common/pkcs12-impl.cpp | 4 +++- src/manager/crypto/sw-backend/obj.h | 3 ++- src/manager/dpl/core/src/binary_queue.cpp | 3 ++- src/manager/main/message-service.h | 5 +++-- src/manager/service/file-system.cpp | 6 +++--- src/manager/service/ocsp.cpp | 3 ++- 8 files changed, 21 insertions(+), 10 deletions(-) diff --git a/packaging/key-manager.spec b/packaging/key-manager.spec index 883f60db..2dabc940 100644 --- a/packaging/key-manager.spec +++ b/packaging/key-manager.spec @@ -149,6 +149,10 @@ Includes ckm_initial_values tool for initial values XML generation export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE" %endif +# needed to surpress sqlcipher errors while its still embedded +export CFLAGS="$CFLAGS -Wno-cast-function-type -Wno-implicit-fallthrough" +export CXXFLAGS="$CXXFLAGS -Wno-cast-function-type -Wno-implicit-fallthrough" + export LDFLAGS+="-Wl,--rpath=%{_libdir},-Bsymbolic-functions " %cmake . -DVERSION=%{version} \ diff --git a/src/manager/common/openssl-error-handler.cpp b/src/manager/common/openssl-error-handler.cpp index a43e0944..c7c12636 100644 --- a/src/manager/common/openssl-error-handler.cpp +++ b/src/manager/common/openssl-error-handler.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 - 2019 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2017-2020 Samsung Electronics Co., Ltd. All rights reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,7 @@ #include "openssl-error-handler.h" #include +#include #include #include #include diff --git a/src/manager/common/pkcs12-impl.cpp b/src/manager/common/pkcs12-impl.cpp index 100e9b5b..17f60a15 100644 --- a/src/manager/common/pkcs12-impl.cpp +++ b/src/manager/common/pkcs12-impl.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2014 - 2019 Samsung Electronics Co. +/* Copyright (c) 2014-2020 Samsung Electronics Co., Ltd. All rights reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,6 +31,8 @@ #include #include +#include + namespace CKM { namespace { diff --git a/src/manager/crypto/sw-backend/obj.h b/src/manager/crypto/sw-backend/obj.h index 0a00734f..aeed086a 100644 --- a/src/manager/crypto/sw-backend/obj.h +++ b/src/manager/crypto/sw-backend/obj.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2000-2020 Samsung Electronics Co., Ltd. All rights reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ * @version 1.0 */ #pragma once +#include #include #include diff --git a/src/manager/dpl/core/src/binary_queue.cpp b/src/manager/dpl/core/src/binary_queue.cpp index 36b174eb..d30e18b0 100644 --- a/src/manager/dpl/core/src/binary_queue.cpp +++ b/src/manager/dpl/core/src/binary_queue.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2011-2020 Samsung Electronics Co., Ltd. All rights reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/src/manager/main/message-service.h b/src/manager/main/message-service.h index fc36cc6d..19fe0747 100644 --- a/src/manager/main/message-service.h +++ b/src/manager/main/message-service.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2000-2020 Samsung Electronics Co., Ltd. All rights reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -98,7 +98,8 @@ template template void MessageService::Register(Mgr &mgr) { - mgr.Register([this](const Msg & msg) { + mgr.template Register([this](const Msg & msg) { + //intentional fall to Unknown option this->AddMessage(msg); }); } diff --git a/src/manager/service/file-system.cpp b/src/manager/service/file-system.cpp index 079a4cd8..5ab97b2d 100644 --- a/src/manager/service/file-system.cpp +++ b/src/manager/service/file-system.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000 - 2019 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2000-2020 Samsung Electronics Co., Ltd. All rights reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -215,11 +215,11 @@ UidVector FileSystem::getUIDsFromDBFile() try { uids.emplace_back(static_cast(std::stoi((filename.c_str()) + CKM_KEY_PREFIX.size()))); - } catch (const std::invalid_argument) { + } catch (const std::invalid_argument &) { LogDebug("Error in extracting uid from db file. " "Error=std::invalid_argument. " "This will be ignored.File=" << filename); - } catch (const std::out_of_range) { + } catch (const std::out_of_range &) { LogDebug("Error in extracting uid from db file. " "Error=std::out_of_range. " "This will be ignored. File=" << filename); diff --git a/src/manager/service/ocsp.cpp b/src/manager/service/ocsp.cpp index c6cb2fd3..0bf71a97 100644 --- a/src/manager/service/ocsp.cpp +++ b/src/manager/service/ocsp.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2019 Samsung Electronics Co., Ltd. All rights reserved + * Copyright (c) 2014-2020 Samsung Electronics Co., Ltd. All rights reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include -- 2.34.1