gnucash stable: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Fri Mar 31 13:42:06 EDT 2023


Updated	 via  https://github.com/Gnucash/gnucash/commit/17e08d0f (commit)
	 via  https://github.com/Gnucash/gnucash/commit/9fa2a48f (commit)
	from  https://github.com/Gnucash/gnucash/commit/d7d9240e (commit)



commit 17e08d0f4375fcd2b4a420647223a9c617241a47
Merge: d7d9240e3d 9fa2a48fe1
Author: John Ralls <jralls at ceridwen.us>
Date:   Fri Mar 31 10:41:30 2023 -0700

    Merge Richard Cohen's 'fix-gcc7-build' into stable.


commit 9fa2a48fe17ead2791b9481ef9ce61a2ac8ddbeb
Author: Richard Cohen <richard at daijobu.co.uk>
Date:   Mon Mar 27 21:58:40 2023 +0100

    Fix build on gcc-8 & 9.
    See https://lists.gnucash.org/pipermail/gnucash-devel/2023-March/046617.html

diff --git a/bindings/guile/gnc-optiondb.i b/bindings/guile/gnc-optiondb.i
index 2343daf49a..0740947c80 100644
--- a/bindings/guile/gnc-optiondb.i
+++ b/bindings/guile/gnc-optiondb.i
@@ -1192,9 +1192,9 @@ inline SCM return_scm_value(ValueType value)
 
     SCM save_scm_value()
     {
-        static const SCM plain_format_str{scm_from_utf8_string("~s")};
-        static const SCM ticked_format_str{scm_from_utf8_string("'~a")};
-        static const SCM list_format_str{scm_from_utf8_string("'~s")};
+        [[maybe_unused]] static const SCM plain_format_str{scm_from_utf8_string("~s")};
+        [[maybe_unused]] static const SCM ticked_format_str{scm_from_utf8_string("'~a")};
+        [[maybe_unused]] static const SCM list_format_str{scm_from_utf8_string("'~s")};
 //scm_simple_format needs a scheme list of arguments to match the format
 //placeholders.
         return std::visit([$self] (auto &option) -> SCM {
@@ -1460,7 +1460,7 @@ inline SCM return_scm_value(ValueType value)
                         if (scm_is_string(new_value))
                         {
                             auto strval{scm_to_utf8_string(new_value)};
-                            GncGUID guid;
+                            GncGUID guid{};
                             string_to_guid(strval, &guid);
                             auto book{get_current_book()};
                             option.set_value(xaccAccountLookup(&guid, book));
@@ -1573,7 +1573,7 @@ inline SCM return_scm_value(ValueType value)
                         if (scm_is_string(new_value))
                         {
                             auto strval{scm_to_utf8_string(new_value)};
-                            GncGUID guid;
+                            GncGUID guid{};
                             string_to_guid(strval, &guid);
                             auto book{get_current_book()};
                             option.set_default_value(xaccAccountLookup(&guid, book));
diff --git a/libgnucash/engine/gnc-option-impl.hpp b/libgnucash/engine/gnc-option-impl.hpp
index 704596ca51..10d4eeab18 100644
--- a/libgnucash/engine/gnc-option-impl.hpp
+++ b/libgnucash/engine/gnc-option-impl.hpp
@@ -328,12 +328,12 @@ template<class OptType,
                                      is_RangeValue_v<OptType>), int> = 0>
 std::istream& operator>>(std::istream& iss, OptType& opt)
 {
-    std::decay_t<decltype(opt.get_value())> value;
     if constexpr (std::is_same_v<std::decay_t<decltype(opt.get_value())>, const _gncOwner*> ||
                   std::is_same_v<std::decay_t<decltype(opt.get_value())>, const _QofQuery*>)
         return iss;
     else
     {
+        std::decay_t<decltype(opt.get_value())> value;
         iss >> value;
         opt.set_value(value);
         return iss;



Summary of changes:
 bindings/guile/gnc-optiondb.i         | 10 +++++-----
 libgnucash/engine/gnc-option-impl.hpp |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)



More information about the gnucash-changes mailing list