summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongkyun, Son <dongkyun.s@samsung.com>2016-10-31 11:23:31 (GMT)
committerDongkyun, Son <dongkyun.s@samsung.com>2016-11-05 13:31:23 (GMT)
commit60462de68d2d08c6d3dbee6daa85cd37407ed9ce (patch)
tree5e8fa866e70c2fadfffbde515eb47f450ef79364
parent4df4f84197b309dcc140bcb447805bc8cf6f320b (diff)
downloadcert-checker-sandbox/dkson95/gcc6.zip
cert-checker-sandbox/dkson95/gcc6.tar.gz
cert-checker-sandbox/dkson95/gcc6.tar.bz2
fix build error by [-Werror=terminate]sandbox/dkson95/gcc6
Destructors are noexcept by default As of C++11, destructors have an implicit noexcept exception-specification (unless a base class or non-static member variable has a destructor that is noexcept(false)). In practice this means that the following program behaves differently in C++11 than in C++03: #include <stdexcept> struct S { ~S() { throw std::runtime_error ("oops"); } }; int main (void) { try { S s; } catch (...) { return 42; } } While in C++03 this program returns 42, in C++11 it terminates with a call to std::terminate. By default GCC will now issue a warning for throw-expressions in noexcept functions, including destructors, that would immediately result in a call to terminate. The new warning can be disabled with -Wno-terminate. It is possible to restore the old behavior when defining the destructor like this: ~S() noexcept(false) { throw std::runtime_error ("oops"); } Signed-off-by: Dongkyun, Son <dongkyun.s@samsung.com>
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/CMakeLists.txt1
2 files changed, 2 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2ff70e3..d175ce1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -43,7 +43,7 @@ SET(CMAKE_CXX_FLAGS_RELEASE "-g -std=c++0x -O2")
SET(CMAKE_CXX_FLAGS_CCOV "-g -std=c++0x -O2 --coverage")
# Set compiler warning flags
-ADD_DEFINITIONS("-Werror") # Make all warnings into errors.
+ADD_DEFINITIONS("-Werror -Wno-terminate") # Make all warnings into errors.
ADD_DEFINITIONS("-Wall") # Generate all warnings
ADD_DEFINITIONS("-Wextra") # Generate even more extra warnings
ADD_DEFINITIONS("-fvisibility=hidden -fPIE") # Hide symbols by default
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 25a1363..be0347a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -76,6 +76,7 @@ TARGET_LINK_LIBRARIES(${TARGET_CERT_CHECKER}
${${TARGET_CERT_CHECKER}_DEP_LIBRARIES}
${TARGET_CERT_CHECKER_COMMON}
-pie
+ -pthread
)
INSTALL(TARGETS ${TARGET_CERT_CHECKER} DESTINATION ${BIN_DIR})