Skip to content

Commit

Permalink
Fix build on gcc-8 & 9.
Browse files Browse the repository at this point in the history
  • Loading branch information
richardcohen authored and jralls committed Mar 31, 2023
1 parent d7d9240 commit 9fa2a48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions bindings/guile/gnc-optiondb.i
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion libgnucash/engine/gnc-option-impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9fa2a48

Please sign in to comment.