From 6ee70830c005810de9ae0315e9030fa0f60904fb Mon Sep 17 00:00:00 2001 From: Tomasz Swierczek Date: Wed, 22 Jan 2020 07:11:29 +0100 Subject: [PATCH] Fix for gcc 9 toochain upgrade Change-Id: If7f8f1e4a00267661ebb66f53111eed9a3ed1460 --- CMakeLists.txt | 3 ++- src/ckm/unprivileged/main.cpp | 3 +-- src/cynara-tests/common/cynara_test_client_async_client.cpp | 6 +++++- src/framework/src/assert.cpp | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 01ce9fbd..bb04faf7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved +# Copyright (c) 2012-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. @@ -83,6 +83,7 @@ ADD_DEFINITIONS("-Wextra") # Generate even more extra warni ADD_DEFINITIONS("-Wno-variadic-macros") # Inhibit variadic macros warnings (needed for ORM) ADD_DEFINITIONS("-Wno-deprecated") # No warnings about deprecated features ADD_DEFINITIONS("-Wno-deprecated-declarations") # No warnings about deprecated features +ADD_DEFINITIONS("-Wno-implicit-fallthrough") # No warnings about switc() statements, often done on purpose ADD_DEFINITIONS("-DCYNARA_DB_DIR=\"${CYNARA_DB_DIR}\"") ADD_DEFINITIONS("-DAPP_USER=\"${APP_USER}\"") diff --git a/src/ckm/unprivileged/main.cpp b/src/ckm/unprivileged/main.cpp index 6f0966fb..0d05a9c0 100644 --- a/src/ckm/unprivileged/main.cpp +++ b/src/ckm/unprivileged/main.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 - 2019 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2016-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. @@ -1267,7 +1267,6 @@ RUNNER_TEST(T13129_get_chain) auto manager = CKM::Manager::create(); RUNNER_ASSERT_MSG(NULL != cert.get(), "Certificate should not be empty"); - RUNNER_ASSERT_MSG(false != cert1.get(), "Certificate should not be empty"); tmp = manager->getCertificateChain(cert, EMPTY_CERT_VECTOR, diff --git a/src/cynara-tests/common/cynara_test_client_async_client.cpp b/src/cynara-tests/common/cynara_test_client_async_client.cpp index 57fc2894..21c94603 100644 --- a/src/cynara-tests/common/cynara_test_client_async_client.cpp +++ b/src/cynara-tests/common/cynara_test_client_async_client.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015 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. @@ -137,6 +137,9 @@ void Client::process(int expectedResult, tv.tv_sec = timeoutSeconds; tv.tv_usec = 0; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wrestrict" + int ret; if (m_statusMonitor.getStatus() == READ) ret = TEMP_FAILURE_RETRY(select(fd + 1, &fds, NULL, NULL, &tv)); @@ -149,6 +152,7 @@ void Client::process(int expectedResult, << " ret = " << ret); return; } +#pragma GCC diagnostic push RUNNER_ASSERT_ERRNO_MSG(ret > 0, "Select returned error:" << " ret = " << ret); diff --git a/src/framework/src/assert.cpp b/src/framework/src/assert.cpp index 636a7cf1..6adc2ef1 100644 --- a/src/framework/src/assert.cpp +++ b/src/framework/src/assert.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. @@ -58,7 +58,7 @@ void AssertProc(const char *condition, INTERNAL_LOG("### Function: " << function); INTERNAL_LOG( "################################################################################"); - } catch (Exception) { + } catch (Exception&) { // Just ignore possible double errors } -- 2.34.1