fix gcc6 build error sandbox/jaehun77/gcc6x
authorDongkyun, Son <dongkyun.s@samsung.com>
Wed, 2 Nov 2016 16:57:42 +0000 (01:57 +0900)
committerJaehun Jeong <jh4u.jeong@samsung.com>
Tue, 27 Dec 2016 09:10:15 +0000 (18:10 +0900)
1. caused by [-Werror=format]
2. caused by [-Werror=shift-overflow]
3. caused by [-Werror=terminate]
4. error: 'pow' was not declared in this scope

Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
CMakeLists.txt
src/manager/dpl/log/src/old_style_log_provider.cpp
src/manager/service/crypto-logic.cpp
src/manager/service/db-crypto.h
tests/test_xml-parser.cpp

index 1ade756..aea4614 100644 (file)
@@ -33,7 +33,7 @@ SET(CMAKE_CXX_FLAGS_PROFILING  "-g -std=c++0x -O0 -pg -Wp,-U_FORTIFY_SOURCE")
 SET(CMAKE_C_FLAGS_DEBUG        "-g -O0 -ggdb -Wp,-U_FORTIFY_SOURCE")
 SET(CMAKE_CXX_FLAGS_DEBUG      "-g -std=c++0x -O0 -ggdb -Wp,-U_FORTIFY_SOURCE")
 SET(CMAKE_C_FLAGS_RELEASE      "-g -O2")
-SET(CMAKE_CXX_FLAGS_RELEASE    "-g -std=c++0x -O2")
+SET(CMAKE_CXX_FLAGS_RELEASE    "-g -std=c++0x -O2 -Wno-shift-overflow")
 SET(CMAKE_C_FLAGS_CCOV         "-g -O2 --coverage")
 SET(CMAKE_CXX_FLAGS_CCOV       "-g -std=c++0x -O2 --coverage")
 
index dabf0b5..ecfbe3b 100644 (file)
@@ -104,7 +104,7 @@ void OldStyleLogProvider::Log(AbstractLogProvider::LogLevel level,
                        std::string("] ") << function << std::string("(): ") << message << mark.end;
                fprintf(stdout, "%s\n", val.str().c_str());
        } catch (const std::out_of_range &) {
-               fprintf(stdout, "Unsupported log level: %d\n", level);
+               fprintf(stdout, "Unsupported log level: %d\n", (int)level);
        }
 }
 
index 32022cd..828fe27 100644 (file)
@@ -56,8 +56,8 @@ const int ENCR_PASSWORD = 1 << 2;
 
 // Encryption order flags (single choice)
 const int ENCR_ORDER_OFFSET = 24;
-const int ENCR_ORDER_FILTER = INT_MAX << ENCR_ORDER_OFFSET; // 0xff000000
-const int ENCR_ORDER_CLEAR = ~ENCR_ORDER_FILTER; // 0x00ffffff
+const int64_t ENCR_ORDER_FILTER = (int64_t)(INT_MAX << ENCR_ORDER_OFFSET); // 0xff000000
+const int64_t ENCR_ORDER_CLEAR = (int64_t)(~ENCR_ORDER_FILTER); // 0x00ffffff
 /*
  * ENCR_ORDER_V1 - v1 encryption order. Token returned from store is encrypted with app key and
  * optionally by custom user password. In such form it is stored in db.
index 501a360..23e4b0c 100644 (file)
@@ -178,7 +178,7 @@ public:
                        }
                }
 
-               ~Transaction()
+               ~Transaction() noexcept(false)
                {
                        try {
                                if (m_inTransaction) {
index ab25ce9..eb292e1 100644 (file)
@@ -23,6 +23,7 @@
 #include <vector>
 #include <boost/test/unit_test.hpp>
 #include <parser.h>
+#include <math.h>
 
 using namespace CKM;
 using namespace XML;