gnucash maint: Multiple changes pushed
Geert Janssens
gjanssens at code.gnucash.org
Wed May 9 16:36:01 EDT 2018
Updated via https://github.com/Gnucash/gnucash/commit/2e53d647 (commit)
via https://github.com/Gnucash/gnucash/commit/1f3cf845 (commit)
from https://github.com/Gnucash/gnucash/commit/27c1df30 (commit)
commit 2e53d647263c20a9e1a9a7fd6893ec7ef186280f
Author: Geert Janssens <geert at kobaltwit.be>
Date: Wed May 9 17:39:29 2018 +0200
Work around gtk warnings with gcc 8.0
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ce4b99a..5310ad1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -556,8 +556,8 @@ set(CMAKE_CXX_FLAGS "-std=gnu++11 ${CMAKE_CXX_FLAGS}") # FIXME: should be -std=
if (UNIX)
set( CMAKE_C_FLAGS "-Werror -Wdeclaration-after-statement -Wno-pointer-sign -Wall -Wmissing-prototypes -Wmissing-declarations -Wno-unused ${CMAKE_C_FLAGS}")
- set( CMAKE_CXX_FLAGS "-Werror -Wall -Wmissing-declarations -Wno-unused ${CMAKE_CXX_FLAGS}")
- set( CMAKE_C_FLAGS "-Wno-deprecated-declarations -std=gnu11 ${CMAKE_C_FLAGS}")
+ set( CMAKE_CXX_FLAGS "-Werror -Wall -Wmissing-declarations -Wno-unused -Wno-error=parentheses ${CMAKE_CXX_FLAGS}")
+ set( CMAKE_C_FLAGS "-Wno-deprecated-declarations -std=gnu11 -Wno-error=parentheses ${CMAKE_C_FLAGS}")
set( CMAKE_C_FLAGS_RELEASE "-O3 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${CMAKE_C_FLAGS}")
endif (UNIX)
if (MINGW)
commit 1f3cf845c4588e787f9b26ad06b05d7cd73326b7
Author: Geert Janssens <geert at kobaltwit.be>
Date: Wed May 9 17:20:13 2018 +0200
Work around a conflict between gcc 8.0 and swig 3.0
The swig 3.0 generated python wrappers trigger a warning converted into an error issued
by gcc 8.0 for using strncpy as follows:
strncpy(buff, "swig_ptr: ", 10);
The reason is this call will truncate the trailing null byte from the string.
This appears to have been fixed in swig master already but that's not released yet
so let disable the warning when compiling the swig wrappers until it is.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e58f9f1..ce4b99a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -524,8 +524,13 @@ endif (Boost_FOUND)
# Compiler flags
+include (CheckCCompilerFlag)
+check_c_compiler_flag(-Wstringop-truncation have_stringop_truncation)
+if (have_stringop_truncation)
+ set(HAVE_STRINGOP_TRUNCATION TRUE)
+endif()
+
if (APPLE)
- include (CheckCCompilerFlag)
include (CheckCxxCompilerFlag)
check_cxx_compiler_flag(-Wno-unused-local-typedef, have_wno_ult)
if (have_wno_ult)
diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt
index df90698..8350920 100644
--- a/bindings/python/CMakeLists.txt
+++ b/bindings/python/CMakeLists.txt
@@ -66,11 +66,17 @@ if(WITH_PYTHON)
target_link_libraries(gnucash_core_c gncmod-app-utils gncmod-engine gnc-module ${GLIB_LIBS} ${PYTHON_LIBRARIES})
set_target_properties(gnucash_core_c PROPERTIES PREFIX "_")
target_compile_options(gnucash_core_c PRIVATE -Wno-implicit -Wno-missing-prototypes -Wno-declaration-after-statement -Wno-missing-declarations)
+ if (HAVE_STRINGOP_TRUNCATION)
+ target_compile_options(gnucash_core_c PRIVATE -Wno-error=stringop-truncation)
+ endif()
add_executable(sqlite3test EXCLUDE_FROM_ALL sqlite3test.c ${SWIG_GNUCASH_CORE_C})
target_link_libraries(sqlite3test gncmod-app-utils gncmod-engine gnc-module ${GLIB_LIBS} ${PYTHON_LIBRARIES})
target_include_directories(sqlite3test PRIVATE ${gnucash_core_c_INCLUDE_DIRS})
target_compile_options(sqlite3test PRIVATE -Wno-implicit -Wno-missing-prototypes -Wno-declaration-after-statement -Wno-missing-declarations)
+ if (HAVE_STRINGOP_TRUNCATION)
+ target_compile_options(sqlite3test PRIVATE -Wno-error=stringop-truncation)
+ endif()
add_test(NAME sqlite3test COMMAND sqlite3test)
add_dependencies(check sqlite3test)
diff --git a/common/test-core/CMakeLists.txt b/common/test-core/CMakeLists.txt
index 229cb39..b57ab5c 100644
--- a/common/test-core/CMakeLists.txt
+++ b/common/test-core/CMakeLists.txt
@@ -48,6 +48,9 @@ if (WITH_PYTHON)
target_link_libraries(unittest_support test-core ${PYTHON_LIBRARIES})
target_include_directories(unittest_support PRIVATE ${PYTHON_INCLUDE_DIRS})
set_target_properties(unittest_support PROPERTIES PREFIX "_")
+ if (HAVE_STRINGOP_TRUNCATION)
+ target_compile_options(unittest_support PRIVATE -Wno-error=stringop-truncation)
+ endif()
endif()
set(test_core_SCHEME unittest-support.scm)
diff --git a/libgnucash/app-utils/CMakeLists.txt b/libgnucash/app-utils/CMakeLists.txt
index d44dbe2..eb6fd3d 100644
--- a/libgnucash/app-utils/CMakeLists.txt
+++ b/libgnucash/app-utils/CMakeLists.txt
@@ -116,6 +116,9 @@ if (WITH_PYTHON)
target_link_libraries(sw_app_utils gncmod-app-utils ${app_utils_ALL_LIBRARIES} ${PYTHON_LIBRARIES})
set_target_properties(sw_app_utils PROPERTIES PREFIX "_")
+ if (HAVE_STRINGOP_TRUNCATION)
+ target_compile_options(sw_app_utils PRIVATE -Wno-error=stringop-truncation)
+ endif()
target_include_directories (sw_app_utils
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
diff --git a/libgnucash/core-utils/CMakeLists.txt b/libgnucash/core-utils/CMakeLists.txt
index fa3972c..0093de0 100644
--- a/libgnucash/core-utils/CMakeLists.txt
+++ b/libgnucash/core-utils/CMakeLists.txt
@@ -171,6 +171,10 @@ if (WITH_PYTHON)
target_link_libraries(sw_core_utils gnc-core-utils ${core_utils_ALL_LIBRARIES} ${PYTHON_LIBRARIES})
set_target_properties(sw_core_utils PROPERTIES PREFIX "_")
+ if (HAVE_STRINGOP_TRUNCATION)
+ target_compile_options(sw_core_utils PRIVATE -Wno-error=stringop-truncation)
+ endif()
+
target_include_directories (sw_core_utils
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
PRIVATE ${core_utils_ALL_INCLUDES} ${PYTHON_INCLUDE_DIRS}
Summary of changes:
CMakeLists.txt | 11 ++++++++---
bindings/python/CMakeLists.txt | 6 ++++++
common/test-core/CMakeLists.txt | 3 +++
libgnucash/app-utils/CMakeLists.txt | 3 +++
libgnucash/core-utils/CMakeLists.txt | 4 ++++
5 files changed, 24 insertions(+), 3 deletions(-)
More information about the gnucash-changes
mailing list