Fix for gcc 9 toochain upgrade 20/223020/1
authorTomasz Swierczek <t.swierczek@samsung.com>
Wed, 22 Jan 2020 06:11:29 +0000 (07:11 +0100)
committerTomasz Swierczek <t.swierczek@samsung.com>
Wed, 22 Jan 2020 07:14:34 +0000 (08:14 +0100)
Change-Id: If7f8f1e4a00267661ebb66f53111eed9a3ed1460

CMakeLists.txt
src/ckm/unprivileged/main.cpp
src/cynara-tests/common/cynara_test_client_async_client.cpp
src/framework/src/assert.cpp

index 01ce9fb..bb04faf 100644 (file)
@@ -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}\"")
 
index 6f0966f..0d05a9c 100644 (file)
@@ -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,
index 57fc289..21c9460 100644 (file)
@@ -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);
index 636a7cf..6adc2ef 100644 (file)
@@ -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
     }