gnucash master: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Thu Feb 16 16:10:34 EST 2023


Updated	 via  https://github.com/Gnucash/gnucash/commit/ec6d38ae (commit)
	 via  https://github.com/Gnucash/gnucash/commit/3a3cf05a (commit)
	 via  https://github.com/Gnucash/gnucash/commit/9c6ad222 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/05975aa5 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/f7027094 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/1204083f (commit)
	 via  https://github.com/Gnucash/gnucash/commit/0aad5696 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/083166b5 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/4eb022c7 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/8a20bcad (commit)
	 via  https://github.com/Gnucash/gnucash/commit/56d95059 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/f63dddcc (commit)
	 via  https://github.com/Gnucash/gnucash/commit/dda1bb83 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/fe57fc41 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/0dd406de (commit)
	 via  https://github.com/Gnucash/gnucash/commit/0f3813e0 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/d4dfe4e2 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/0798bce2 (commit)
	from  https://github.com/Gnucash/gnucash/commit/9efbdc15 (commit)



commit ec6d38ae15297a108ff67190d8071912d9590871
Merge: 9efbdc15c 3a3cf05ab
Author: John Ralls <jralls at ceridwen.us>
Date:   Thu Feb 16 12:29:05 2023 -0800

    Merge Richard Cohen's 'fix-unused-1' into master.


commit 3a3cf05ab5a3b21ad6107a0d18c3ea5a0fca38b3
Author: Richard Cohen <richard at daijobu.co.uk>
Date:   Mon Feb 13 20:14:17 2023 +0000

    Turn on -Wunused

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4dbdc2dc8..03be45e3b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -587,14 +587,14 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
 set(CMAKE_C_EXTENSIONS ON)
 
 if (UNIX)
-  set( CMAKE_C_FLAGS "-Werror -Wno-pointer-sign -Wall -Wmissing-prototypes -Wmissing-declarations -Wno-unused ${CMAKE_C_FLAGS}")
+  set( CMAKE_C_FLAGS "-Werror -Wno-pointer-sign -Wall -Wmissing-prototypes -Wmissing-declarations ${CMAKE_C_FLAGS}")
   set( CMAKE_C_FLAGS "-Wno-error=deprecated-declarations -Wno-error=parentheses ${CMAKE_C_FLAGS}")
-  set( CMAKE_CXX_FLAGS "-Werror -Wall -Wmissing-declarations -Wno-unused -Wno-error=parentheses ${CMAKE_CXX_FLAGS}")
+  set( CMAKE_CXX_FLAGS "-Werror -Wall -Wmissing-declarations -Wno-error=parentheses ${CMAKE_CXX_FLAGS}")
   set( CMAKE_CXX_FLAGS "-Wno-error=deprecated-declarations ${REGISTER_CXXFLAG} ${CMAKE_CXX_FLAGS}")
   set( CMAKE_C_FLAGS_RELEASE "-O3 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 ${CMAKE_C_FLAGS}")
 endif()
 if (MINGW)
-  set( CMAKE_C_FLAGS "-Werror -Wno-pointer-sign -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations  -Wno-unused -Wno-error=deprecated-declarations ${CMAKE_C_FLAGS}")
+  set( CMAKE_C_FLAGS "-Werror -Wno-pointer-sign -Wall -Wmissing-prototypes -Wmissing-declarations -Wno-error=deprecated-declarations ${CMAKE_C_FLAGS}")
   set( CMAKE_CXX_FLAGS "-DWINVER=0x0500 -D_EMULATE_GLIBC=0 ${CMAKE_CXX_FLAGS}") # Workaround for bug in gtest on mingw, see https://github.com/google/googletest/issues/893 and https://github.com/google/googletest/issues/920
 endif()
 

commit 9c6ad222a907e86121cdfc4e48800b5da69bd810
Author: Richard Cohen <richard at daijobu.co.uk>
Date:   Sat Jan 28 16:22:16 2023 +0000

    [-Wunused-function] - remove

diff --git a/gnucash/gnome-utils/dialog-account.c b/gnucash/gnome-utils/dialog-account.c
index 242d6734a..4b0a598b3 100644
--- a/gnucash/gnome-utils/dialog-account.c
+++ b/gnucash/gnome-utils/dialog-account.c
@@ -1524,16 +1524,6 @@ opening_equity_cb (GtkWidget *w, gpointer data)
     gtk_widget_set_sensitive (aw->transfer_account_scroll, !use_equity);
 }
 
-static void
-gnc_name_entry_realize (GtkWidget *widget, gpointer user_data)
-{
-    GtkWidget *commodity_box = user_data;
-    GtkAllocation alloc;
-
-    gtk_widget_get_allocation (widget, &alloc);
-    gtk_widget_set_size_request (commodity_box, -1, alloc.height);
-}
-
 /********************************************************************\
  * gnc_account_window_create                                        *
  *   creates a window to create a new account.                      *
diff --git a/gnucash/gnome-utils/dialog-options.cpp b/gnucash/gnome-utils/dialog-options.cpp
index 20da225b3..cec82663f 100644
--- a/gnucash/gnome-utils/dialog-options.cpp
+++ b/gnucash/gnome-utils/dialog-options.cpp
@@ -75,11 +75,6 @@ static void dialog_reset_cb(GtkWidget * w, gpointer data);
 static void dialog_list_select_cb (GtkTreeSelection *selection, gpointer data);
 static void component_close_handler (gpointer data);
 
-static void
-section_reset_widgets(GncOptionSection* section)
-{
-}
-
 static inline GtkWidget* const
 option_get_gtk_widget (const GncOption* option)
 {
@@ -649,12 +644,6 @@ GncOptionsDialog::set_book_help_cb() noexcept
     set_help_cb((GncOptionsDialogCallback)gnc_book_options_help_cb, nullptr);
 }
 
-static void
-gnc_global_options_help_cb (GncOptionsDialog *win, gpointer dat)
-{
-    gnc_gnome_help (GTK_WINDOW(win->get_widget()), DF_MANUAL, DL_GLOBPREFS);
-}
-
 static void
 gnc_style_sheet_options_help_cb (GncOptionsDialog *win, gpointer dat)
 {
diff --git a/gnucash/gnome-utils/gnc-cell-view.c b/gnucash/gnome-utils/gnc-cell-view.c
index f81e8a217..47ffa503d 100644
--- a/gnucash/gnome-utils/gnc-cell-view.c
+++ b/gnucash/gnome-utils/gnc-cell-view.c
@@ -30,8 +30,6 @@
 static void     gnc_cell_view_init          (GncCellView          *cv);
 static void     gnc_cell_view_class_init    (GncCellViewClass     *klass);
 static void     gnc_cell_view_editable_init (GtkCellEditableIface *iface);
-static gboolean gcv_key_press_event         (GtkWidget            *box,
-                                             GdkEventKey          *key_event);
 
 static void     gnc_cell_view_set_property  (GObject              *object,
                                              guint                 param_id,
diff --git a/gnucash/gnome-utils/gnc-option-gtk-ui.cpp b/gnucash/gnome-utils/gnc-option-gtk-ui.cpp
index eebc9a106..a9fb30b30 100644
--- a/gnucash/gnome-utils/gnc-option-gtk-ui.cpp
+++ b/gnucash/gnome-utils/gnc-option-gtk-ui.cpp
@@ -1699,34 +1699,6 @@ create_option_widget<GncOptionUIType::DATE_FORMAT> (GncOption& option,
     grid_attach_widget(page_box, enclosing, row);
 }
 
-static void
-gnc_plot_size_option_set_select_method(GncOption& option, bool set_buttons)
-{
-    GList* widget_list;
-    GtkWidget *px_widget, *p_widget;
-    GtkWidget *widget;
-
-    widget = option_get_gtk_widget(&option);
-
-    widget_list = gtk_container_get_children(GTK_CONTAINER(widget));
-    // px_button item 0
-    px_widget = static_cast<decltype(px_widget)>(g_list_nth_data(widget_list, 1));
-    // p_button item 2
-    p_widget = static_cast<decltype(p_widget)>(g_list_nth_data(widget_list, 3));
-    g_list_free(widget_list);
-
-    if (set_buttons)
-    {
-        gtk_widget_set_sensitive(px_widget, TRUE);
-        gtk_widget_set_sensitive(p_widget, FALSE);
-    }
-    else
-    {
-        gtk_widget_set_sensitive(p_widget, TRUE);
-        gtk_widget_set_sensitive(px_widget, FALSE);
-    }
-}
-
 static void
 gnc_rd_option_px_set_cb(GtkWidget *widget, GncOption* option)
 {
diff --git a/gnucash/gnome/dialog-imap-editor.c b/gnucash/gnome/dialog-imap-editor.c
index 6fa624a51..8c9d31025 100644
--- a/gnucash/gnome/dialog-imap-editor.c
+++ b/gnucash/gnome/dialog-imap-editor.c
@@ -391,24 +391,6 @@ gnc_imap_invalid_maps_dialog (ImapDialog *imap_dialog)
     }
 }
 
-static void
-gnc_imap_invalid_maps (ImapDialog *imap_dialog)
-{
-    gboolean inv_dialog_shown = FALSE;
-
-    if ((imap_dialog->type == BAYES) && (imap_dialog->inv_dialog_shown.inv_dialog_shown_bayes))
-        inv_dialog_shown = TRUE;
-
-    if ((imap_dialog->type == NBAYES) && (imap_dialog->inv_dialog_shown.inv_dialog_shown_nbayes))
-        inv_dialog_shown = TRUE;
-
-    if ((imap_dialog->type == ONLINE) && (imap_dialog->inv_dialog_shown.inv_dialog_shown_online))
-        inv_dialog_shown = TRUE;
-
-    if (!inv_dialog_shown)
-        gnc_imap_invalid_maps_dialog (imap_dialog);
-}
-
 void
 gnc_imap_dialog_response_cb (GtkDialog *dialog, gint response_id, gpointer user_data)
 {
diff --git a/gnucash/gnome/dialog-payment.c b/gnucash/gnome/dialog-payment.c
index 7703298d2..6c7c1cc54 100644
--- a/gnucash/gnome/dialog-payment.c
+++ b/gnucash/gnome/dialog-payment.c
@@ -730,13 +730,6 @@ gnc_payment_dialog_remember_account (PaymentWindow *pw, Account *acc)
 }
 
 
-static void
-gnc_payment_set_owner (PaymentWindow *pw, GncOwner *owner)
-{
-    gnc_owner_set_owner (pw->owner_choice, owner);
-    gnc_payment_dialog_owner_changed(pw);
-}
-
 static void
 gnc_payment_update_style_classes (PaymentWindow *pw)
 {
diff --git a/gnucash/gnome/gnc-plugin-budget.c b/gnucash/gnome/gnc-plugin-budget.c
index a251c3a49..03b0e9878 100644
--- a/gnucash/gnome/gnc-plugin-budget.c
+++ b/gnucash/gnome/gnc-plugin-budget.c
@@ -45,8 +45,6 @@ static QofLogModule log_module = GNC_MOD_GUI;
 static void gnc_plugin_budget_class_init (GncPluginBudgetClass *klass);
 static void gnc_plugin_budget_init (GncPluginBudget *plugin);
 static void gnc_plugin_budget_finalize (GObject *object);
-static void gnc_plugin_budget_add_to_window (GncPlugin *plugin,
-                                             GncMainWindow *window, GQuark type);
 
 /* Command Callbacks */
 static void gnc_plugin_budget_cmd_new_budget (GSimpleAction *simple, GVariant *parameter, gpointer user_data);
diff --git a/gnucash/gnome/gnc-plugin-page-invoice.c b/gnucash/gnome/gnc-plugin-page-invoice.c
index f89569c8e..a9caf9e87 100644
--- a/gnucash/gnome/gnc-plugin-page-invoice.c
+++ b/gnucash/gnome/gnc-plugin-page-invoice.c
@@ -87,7 +87,6 @@ static void gnc_plugin_page_invoice_cmd_pay_invoice (GSimpleAction *simple, GVar
 static void gnc_plugin_page_invoice_cmd_save_layout (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
 static void gnc_plugin_page_invoice_cmd_reset_layout (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
 static void gnc_plugin_page_invoice_cmd_link (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
-static void gnc_plugin_page_invoice_cmd_link_remove (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
 static void gnc_plugin_page_invoice_cmd_link_open (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
 static void gnc_plugin_page_invoice_cmd_company_report (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
 static void gnc_plugin_page_invoice_cmd_entryUp (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
@@ -1311,34 +1310,6 @@ gnc_plugin_page_invoice_cmd_link (GSimpleAction *simple,
     LEAVE(" ");
 }
 
-static void
-gnc_plugin_page_invoice_cmd_link_remove (GSimpleAction *simple,
-                                         GVariant *paramter,
-                                         gpointer user_data)
-{
-    GncPluginPageInvoice *plugin_page = user_data;
-    GncPluginPageInvoicePrivate *priv;
-    GncInvoice *invoice;
-    GtkWidget *doclink_button;
-
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
-    ENTER("(action %p, plugin_page %p)", simple, plugin_page);
-    priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
-
-    invoice = gnc_invoice_window_get_invoice (priv->iw);
-    gncInvoiceSetDocLink (invoice, "");
-
-    doclink_button = gnc_invoice_window_get_doclink_button (priv->iw);
-
-    if (doclink_button)
-        gtk_widget_hide (GTK_WIDGET(doclink_button));
-
-    // update the menu actions
-    update_doclink_actions (GNC_PLUGIN_PAGE(plugin_page), FALSE);
-
-    LEAVE(" ");
-}
-
 static void
 gnc_plugin_page_invoice_cmd_link_open (GSimpleAction *simple,
                                        GVariant *paramter,
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index 637ee6c7d..be69e5fd1 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -222,7 +222,6 @@ static void gnc_plugin_page_register_cmd_account_report (GSimpleAction *simple,
 static void gnc_plugin_page_register_cmd_transaction_report (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
 static void gnc_plugin_page_register_cmd_linked_transaction (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
 static void gnc_plugin_page_register_cmd_linked_transaction_open (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
-static void gnc_plugin_page_register_cmd_linked_transaction_remove (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
 static void gnc_plugin_page_register_cmd_jump_linked_invoice (GSimpleAction *simple, GVariant *paramter, gpointer user_data);
 
 static void gnc_plugin_page_help_changed_cb (GNCSplitReg* gsr,
@@ -4535,25 +4534,6 @@ gnc_plugin_page_register_cmd_linked_transaction_open (GSimpleAction *simple,
     LEAVE (" ");
 }
 
-static void
-gnc_plugin_page_register_cmd_linked_transaction_remove (GSimpleAction *simple,
-                                                        GVariant      *paramter,
-                                                        gpointer       user_data)
-{
-    GncPluginPageRegister* page = user_data;
-    GncPluginPageRegisterPrivate* priv;
-
-    ENTER ("(action %p, page %p)", simple, page);
-
-    g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
-
-    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
-    gsr_default_doclink_remove_handler (priv->gsr);
-    gnc_plugin_page_register_ui_update (NULL, page);
-    LEAVE (" ");
-
-}
-
 static GncInvoice* invoice_from_split (Split* split)
 {
     GncInvoice* invoice;
diff --git a/gnucash/import-export/csv-imp/gnc-imp-settings-csv-price.cpp b/gnucash/import-export/csv-imp/gnc-imp-settings-csv-price.cpp
index fe2e5296b..c1ebcff74 100644
--- a/gnucash/import-export/csv-imp/gnc-imp-settings-csv-price.cpp
+++ b/gnucash/import-export/csv-imp/gnc-imp-settings-csv-price.cpp
@@ -62,28 +62,6 @@ static std::shared_ptr<CsvPriceImpSettings> create_int_no_preset(void)
     return preset;
 }
 
-static std::shared_ptr<CsvPriceImpSettings> create_int_gnc_exp_preset(void)
-{
-    auto preset = std::make_shared<CsvPriceImpSettings>();
-    preset->m_name = get_gnc_exp();
-    preset->m_skip_start_lines = 1;
-
-    /* FIXME date and currency format should still be aligned with export format!
-     * That's currently hard to do, because the export uses whatever the user
-     * had set as global preference.
-    preset->date_active = 0;
-    preset->currency_active = 0;
-    */
-    preset->m_column_types_price = {
-            GncPricePropType::DATE,
-            GncPricePropType::AMOUNT,
-            GncPricePropType::FROM_SYMBOL,
-            GncPricePropType::FROM_NAMESPACE,
-            GncPricePropType::TO_CURRENCY
-    };
-    return preset;
-}
-
 /**************************************************
  * find
  *
diff --git a/gnucash/import-export/import-account-matcher.c b/gnucash/import-export/import-account-matcher.c
index 9add090ba..0795d5294 100644
--- a/gnucash/import-export/import-account-matcher.c
+++ b/gnucash/import-export/import-account-matcher.c
@@ -57,17 +57,6 @@ typedef struct
     const char* online_id;
 } AccountOnlineMatch;
 
-static Account*
-partial_match_if_valid (AccountOnlineMatch *match)
-{
-    if (match->partial_match && match->count == 1)
-        return match->partial_match;
-    else
-        PERR("Online ID %s partially matches %d accounts and fully matches none",
-             match->online_id, match->count);
-    return NULL;
-}
-
 /*-******************************************************************\
  * Functions needed by gnc_import_select_account
  *
diff --git a/gnucash/import-export/import-backend.cpp b/gnucash/import-export/import-backend.cpp
index c94f337f6..23df1f601 100644
--- a/gnucash/import-export/import-backend.cpp
+++ b/gnucash/import-export/import-backend.cpp
@@ -742,26 +742,6 @@ void split_find_match (GNCImportTransInfo * trans_info,
 /***********************************************************************
  */
 
-/* append the imported transaction description to the matched transaction description */
-static void
-desc_append (Transaction* selected_match_trans, gchar *new_desc)
-{
-    auto curr_desc = xaccTransGetDescription (selected_match_trans);
-    auto tmp = g_strconcat(curr_desc, "|", new_desc, nullptr);
-    xaccTransSetDescription (selected_match_trans, tmp);
-    g_free (tmp);
-}
-
-/* append the imported transaction notes to the matched transaction notes */
-static void
-notes_append (Transaction* selected_match_trans, gchar* new_notes)
-{
-    auto curr_notes = xaccTransGetNotes (selected_match_trans);
-    auto tmp = g_strconcat (curr_notes, "|", new_notes, nullptr);
-    xaccTransSetNotes (selected_match_trans, tmp );
-    g_free (tmp);
-}
-
 static char*
 maybe_append_string (const char* match_string, const char* imp_string)
 {
@@ -1005,44 +985,6 @@ gnc_import_process_trans_item (Account *base_acc,
     return false;
 }
 
-/********************************************************************\
- * check_trans_online_id() Callback function used by
- * gnc_import_exists_online_id.  Takes pointers to transaction and split,
- * returns 0 if their online_ids  do NOT match, or if the split
- * belongs to the transaction
-\********************************************************************/
-static gint check_trans_online_id(Transaction *trans1, void *user_data)
-{
-    gchar *online_id1, *online_id2;
-    gint retval;
-
-    auto split2 = static_cast<Split*>(user_data);
-    auto account = xaccSplitGetAccount(split2);
-    auto split1 = xaccTransFindSplitByAccount(trans1, account);
-    if (split1 == split2)
-        return 0;
-
-    /* hack - we really want to iterate over the _splits_ of the account
-       instead of the transactions */
-    g_assert(split1);
-
-    online_id1 = gnc_import_get_split_online_id (split1);
-
-    if (!online_id1 || !*online_id1)
-    {
-        g_free (online_id1);
-        online_id1 = gnc_import_get_trans_online_id (trans1);
-    }
-
-    online_id2 = gnc_import_get_split_online_id(split2);
-
-    retval = (!online_id1 || !online_id2 || strcmp (online_id1, online_id2)) ? 0 : 1;
-
-    g_free (online_id1);
-    g_free (online_id2);
-    return retval;
-}
-
 static GHashTable*
 hash_account_online_ids (Account *account)
 {
diff --git a/gnucash/import-export/import-main-matcher.c b/gnucash/import-export/import-main-matcher.c
index f261c0a3a..99047aaef 100644
--- a/gnucash/import-export/import-main-matcher.c
+++ b/gnucash/import-export/import-main-matcher.c
@@ -650,33 +650,6 @@ on_matcher_help_clicked (GtkButton *button, gpointer user_data)
     gtk_widget_show (help_dialog);
 }
 
-static void
-run_account_picker_dialog (GNCImportMainMatcher *info,
-                           GtkTreeModel *model,
-                           GtkTreeIter *iter,
-                           GNCImportTransInfo *trans_info)
-{
-    g_assert (trans_info);
-
-    Account *old_acc = gnc_import_TransInfo_get_destacc (trans_info);
-
-    gboolean ok_pressed;
-    Account *new_acc = gnc_import_select_account (
-             info->main_widget,
-             NULL,
-             true,
-             _("Destination account for the auto-balance split."),
-             xaccTransGetCurrency (gnc_import_TransInfo_get_trans (trans_info)),
-             ACCT_TYPE_NONE,
-             old_acc,
-             &ok_pressed);
-    if (ok_pressed)
-    {
-        gnc_import_TransInfo_set_destacc (trans_info, new_acc, true);
-        defer_bal_computation (info, new_acc);
-    }
-}
-
 static void
 run_match_dialog (GNCImportMainMatcher *info,
                   GNCImportTransInfo *trans_info)
diff --git a/gnucash/register/ledger-core/split-register-model.c b/gnucash/register/ledger-core/split-register-model.c
index bc5565118..52645684b 100644
--- a/gnucash/register/ledger-core/split-register-model.c
+++ b/gnucash/register/ledger-core/split-register-model.c
@@ -507,15 +507,6 @@ gnc_split_register_get_fcredit_label (VirtualLocation virt_loc,
 }
 
 
-static char*
-gnc_split_register_get_default_tooltip (VirtualLocation virt_loc,
-                                        gpointer user_data)
-{
-    SplitRegister* reg = user_data;
-    const char* tooltip = gnc_table_get_entry (reg->table, virt_loc);
-
-    return g_strdup (tooltip);
-}
 
 static char*
 gnc_split_register_get_recn_tooltip (VirtualLocation virt_loc,
@@ -2706,8 +2697,6 @@ gnc_split_register_model_new (void)
                                        RBALN_CELL);
 
     // tooltip handlers
-//    gnc_table_model_set_default_tooltip_handler(
-//        model, gnc_split_register_get_default_tooltip);
 
     gnc_table_model_set_tooltip_handler (model,
                                          gnc_split_register_get_recn_tooltip,
diff --git a/gnucash/register/register-gnome/gnucash-sheet-private.c b/gnucash/register/register-gnome/gnucash-sheet-private.c
index 9db025869..e9d977c7c 100644
--- a/gnucash/register/register-gnome/gnucash-sheet-private.c
+++ b/gnucash/register/register-gnome/gnucash-sheet-private.c
@@ -257,30 +257,6 @@ static guint32 inc_intensity_10percent (guint32 argb)
 }
 #endif
 
-/** For a given byte value, multiply the value by a rational number,
-specified by numerator and denominator. This is some simple integer arithmetics
-for the case when we don't even need a conversion to floating point and
-backwards. */
-static guint8 dec_intensity_byte (guint8 input, int numerator, int denominator)
-{
-    guint8 result;
-    result = (input * numerator) / denominator;
-    return result;
-}
-
-/** For a given RGB value, decrease the color intensity for each of the three
-colors identically by 10 percent and return this changed RGB value. */
-static guint32 dec_intensity_10percent (guint32 argb)
-{
-    // Multiply each single byte by 9/10 i.e. by 0.9 which decreases the
-    // intensity by 10 percent.
-    guint32 result =
-            (dec_intensity_byte ((argb & 0x00FF0000) >> 16, 9, 10) << 16)
-            + (dec_intensity_byte ((argb & 0x0000FF00) >> 8, 9, 10) << 8)
-            + (dec_intensity_byte (argb & 0x000000FF, 9, 10));
-    return result;
-}
-
 /* Actual drawing routines */
 
 static inline void
diff --git a/gnucash/register/register-gnome/gnucash-sheet.c b/gnucash/register/register-gnome/gnucash-sheet.c
index 0222e96ee..d2ef3ce62 100644
--- a/gnucash/register/register-gnome/gnucash-sheet.c
+++ b/gnucash/register/register-gnome/gnucash-sheet.c
@@ -145,19 +145,6 @@ gnucash_sheet_set_position (GnucashSheet* sheet, int pos)
     gnucash_sheet_set_position_and_selection (sheet, pos, pos, pos);
 }
 
-static inline void
-gnucash_sheet_get_selection (GnucashSheet *sheet, int *start, int *end)
-{
-    *start = sheet->pos;
-    *end = sheet->bound;
-}
-
-static inline void
-gnucash_sheet_clear_selection (GnucashSheet *sheet)
-{
-    gnucash_sheet_set_selection (sheet, sheet->pos, sheet->pos);
-}
-
 static inline void
 gnucash_sheet_set_entry_value (GnucashSheet *sheet, const char* value)
 {
diff --git a/libgnucash/app-utils/gfec.c b/libgnucash/app-utils/gfec.c
index 049163376..f53dd00fa 100644
--- a/libgnucash/app-utils/gfec.c
+++ b/libgnucash/app-utils/gfec.c
@@ -35,12 +35,6 @@ gfec_string_from_locale(void *data)
     return scm_from_locale_string(str);
 }
 
-static SCM
-gfec_string_outer_handler(void *data, SCM key, SCM args)
-{
-    return SCM_UNDEFINED;
-}
-
 static SCM
 gfec_string_inner_handler(void *data, SCM key, SCM args)
 {
diff --git a/libgnucash/backend/dbi/test/test-dbi-stuff.cpp b/libgnucash/backend/dbi/test/test-dbi-stuff.cpp
index 24f8a91c7..6e6668896 100644
--- a/libgnucash/backend/dbi/test/test-dbi-stuff.cpp
+++ b/libgnucash/backend/dbi/test/test-dbi-stuff.cpp
@@ -40,11 +40,6 @@
 
 G_GNUC_UNUSED static QofLogModule log_module = "test-dbi";
 
-/* Placeholder for some old functions that need to be re-written and enabled */
-static void do_test (G_GNUC_UNUSED gboolean foo, G_GNUC_UNUSED gchar* bar)
-{
-}
-
 void
 do_compare (QofBook* book_1, QofBook* book_2, const gchar* id,
             QofInstanceForeachCB cb, const gchar* msg)
diff --git a/libgnucash/backend/sql/gnc-slots-sql.cpp b/libgnucash/backend/sql/gnc-slots-sql.cpp
index 0d8d0470a..0e9fc17a8 100644
--- a/libgnucash/backend/sql/gnc-slots-sql.cpp
+++ b/libgnucash/backend/sql/gnc-slots-sql.cpp
@@ -183,18 +183,6 @@ GncSqlSlotsBackend::GncSqlSlotsBackend() :
 
 /* ================================================================= */
 
-inline static std::string::size_type
-get_final_delim(std::string& path)
-{
-    auto idx = path.rfind('/');
-    while (idx == path.length())
-    {
-        path.erase(idx);
-        idx = path.rfind('/');
-    }
-    return idx;
-}
-
 static std::string
 get_key (slot_info_t* pInfo)
 {
@@ -790,31 +778,6 @@ load_obj_guid (const GncSqlBackend* sql_be, GncSqlRow& row)
     return &guid;
 }
 
-static void
-load_slot_for_list_item (GncSqlBackend* sql_be, GncSqlRow& row,
-                         QofCollection* coll)
-{
-    slot_info_t slot_info = { NULL, NULL, TRUE, NULL, KvpValue::Type::INVALID,
-                              NULL, FRAME, NULL, "" };
-    const GncGUID* guid;
-    QofInstance* inst;
-
-    g_return_if_fail (sql_be != NULL);
-    g_return_if_fail (coll != NULL);
-
-    guid = load_obj_guid (sql_be, row);
-    g_assert (guid != NULL);
-    inst = qof_collection_lookup_entity (coll, guid);
-
-    slot_info.be = sql_be;
-    slot_info.pKvpFrame = qof_instance_get_slots (inst);
-    slot_info.context = NONE;
-
-    gnc_sql_load_object (sql_be, row, TABLE_NAME, &slot_info, col_table);
-
-
-}
-
 static void
 load_slot_for_book_object (GncSqlBackend* sql_be, GncSqlRow& row,
                            BookLookupFn lookup_fn)
diff --git a/libgnucash/backend/sql/gnc-transaction-sql.cpp b/libgnucash/backend/sql/gnc-transaction-sql.cpp
index 54c0aab3b..c04fc4cdd 100644
--- a/libgnucash/backend/sql/gnc-transaction-sql.cpp
+++ b/libgnucash/backend/sql/gnc-transaction-sql.cpp
@@ -723,168 +723,6 @@ GncSqlTransBackend::load_all (GncSqlBackend* sql_be)
                                    nullptr);
 }
 
-static void
-convert_query_comparison_to_sql (QofQueryPredData* pPredData,
-                                 gboolean isInverted, std::stringstream& sql)
-{
-    if (pPredData->how == QOF_COMPARE_LT
-        || (isInverted && pPredData->how == QOF_COMPARE_GTE))
-        sql << "<";
-    else if (pPredData->how == QOF_COMPARE_LTE
-             || (isInverted && pPredData->how == QOF_COMPARE_GT))
-        sql << "<=";
-    else if (pPredData->how == QOF_COMPARE_EQUAL
-             || (isInverted && pPredData->how == QOF_COMPARE_NEQ))
-        sql << "=";
-    else if (pPredData->how == QOF_COMPARE_GT
-             || (isInverted && pPredData->how == QOF_COMPARE_LTE))
-        sql << ">";
-    else if (pPredData->how == QOF_COMPARE_GTE
-             || (isInverted && pPredData->how == QOF_COMPARE_LT))
-        sql << ">=";
-    else if (pPredData->how == QOF_COMPARE_NEQ
-             || (isInverted && pPredData->how == QOF_COMPARE_EQUAL))
-        sql <<  "~=";
-    else
-    {
-        PERR ("Unknown comparison type\n");
-        sql << "??";
-    }
-}
-
-static void
-convert_query_term_to_sql (const GncSqlBackend* sql_be, const gchar* fieldName,
-                           QofQueryTerm* pTerm, std::stringstream& sql)
-{
-    QofQueryPredData* pPredData;
-    gboolean isInverted;
-
-    g_return_if_fail (pTerm != NULL);
-
-    pPredData = qof_query_term_get_pred_data (pTerm);
-    isInverted = qof_query_term_is_inverted (pTerm);
-
-    if (g_strcmp0 (pPredData->type_name, QOF_TYPE_GUID) == 0)
-    {
-        query_guid_t guid_data = (query_guid_t)pPredData;
-        GList* guid_entry;
-        sql << "(" << fieldName;
-
-        switch (guid_data->options)
-        {
-        case QOF_GUID_MATCH_ANY:
-            sql << (isInverted ? " NOT IN (" : " IN (");
-            break;
-
-        case QOF_GUID_MATCH_NONE:
-            sql << (isInverted ? " IN (" : " NOT IN (");
-            break;
-
-        default:
-            PERR ("Unexpected GncGUID match type: %d\n", guid_data->options);
-        }
-
-        for (guid_entry = guid_data->guids; guid_entry != NULL;
-             guid_entry = guid_entry->next)
-        {
-            gchar guid_buf[GUID_ENCODING_LENGTH + 1];
-
-            if (guid_entry != guid_data->guids) sql << ",";
-            (void)guid_to_string_buff (static_cast<GncGUID*> (guid_entry->data),
-                                       guid_buf);
-            sql << guid_buf;
-        }
-        sql << "))";
-
-    }
-    else if (g_strcmp0 (pPredData->type_name, QOF_TYPE_CHAR) == 0)
-    {
-        query_char_t char_data = (query_char_t)pPredData;
-        int i;
-
-        if (isInverted) sql <<  "NOT(";
-        if (char_data->options == QOF_CHAR_MATCH_NONE) sql << "NOT ";
-        sql << "(";
-        for (i = 0; char_data->char_list[i] != '\0'; i++)
-        {
-            if (i != 0) sql << " OR ";
-            sql << fieldName << " = '" << char_data->char_list[i] << "'";
-        }
-        sql << ") ";
-        if (isInverted) sql << ") ";
-    }
-    else if (g_strcmp0 (pPredData->type_name, QOF_TYPE_STRING) == 0)
-    {
-        query_string_t string_data = (query_string_t)pPredData;
-        sqlEscape* escape = sqlEscape_new ();
-
-        if (isInverted ||  pPredData->how == QOF_COMPARE_NEQ)
-            sql << "NOT(";
-        sql << fieldName;
-        if (string_data->is_regex ||
-            string_data->options == QOF_STRING_MATCH_CASEINSENSITIVE)
-        {
-            PWARN ("String is_regex || option = QOF_STRING_MATCH_INSENSITIVE\n");
-        }
-//          sql << " ~" ;
-//      } else {
-        sql << " =";
-//      }
-//      if( string_data->options == QOF_STRING_MATCH_CASEINSENSITIVE ) {
-//          sql+= "*";
-//      }
-        sql << "'" << sqlEscapeString (escape, string_data->matchstring) << "'";
-        if (pPredData->how == QOF_COMPARE_NEQ) sql << ")";
-        if (isInverted) sql << ")";
-        sqlEscape_destroy (escape);
-
-    }
-    else
-    {
-        sql << "(" << fieldName;
-        convert_query_comparison_to_sql (pPredData, isInverted, sql);
-
-        if (strcmp (pPredData->type_name, QOF_TYPE_NUMERIC) == 0)
-        {
-            query_numeric_t pData = (query_numeric_t)pPredData;
-            sql << gnc_numeric_to_double (pData->amount);
-        }
-        else if (g_strcmp0 (pPredData->type_name, QOF_TYPE_DATE) == 0)
-        {
-            query_date_t date_data = (query_date_t)pPredData;
-
-            GncDateTime time(date_data->date);
-            sql << time.format_iso8601();
-        }
-        else if (strcmp (pPredData->type_name, QOF_TYPE_INT32) == 0)
-        {
-            query_int32_t pData = (query_int32_t)pPredData;
-            sql << pData->val;
-        }
-        else if (strcmp (pPredData->type_name, QOF_TYPE_INT64) == 0)
-        {
-            query_int64_t pData = (query_int64_t)pPredData;
-            sql << pData->val;
-        }
-        else if (strcmp (pPredData->type_name, QOF_TYPE_DOUBLE) == 0)
-        {
-            query_double_t pData = (query_double_t)pPredData;
-            sql << pData->val;
-        }
-        else if (strcmp (pPredData->type_name, QOF_TYPE_BOOLEAN) == 0)
-        {
-            query_boolean_t pData = (query_boolean_t)pPredData;
-            sql << pData->val;
-        }
-        else
-        {
-            PERR ("Unknown query predicate type: %s\n", pPredData->type_name);
-        }
-
-        sql << ")";
-    }
-}
-
 typedef struct
 {
     GncSqlStatementPtr stmt;
diff --git a/libgnucash/backend/xml/gnc-transaction-xml-v2.cpp b/libgnucash/backend/xml/gnc-transaction-xml-v2.cpp
index cc58b0f0a..03ac80b01 100644
--- a/libgnucash/backend/xml/gnc-transaction-xml-v2.cpp
+++ b/libgnucash/backend/xml/gnc-transaction-xml-v2.cpp
@@ -433,16 +433,6 @@ set_tran_time64 (xmlNodePtr node, Transaction * trn,
     return TRUE;
 }
 
-static inline gboolean
-set_tran_date (xmlNodePtr node, Transaction* trn,
-               void (*func) (Transaction* trn, const time64 tm))
-{
-    time64 time = dom_tree_to_time64 (node);
-    if (!dom_tree_valid_time64 (time, node->name)) time = 0;
-    func (trn, time);
-    return TRUE;
-}
-
 static gboolean
 trn_id_handler (xmlNodePtr node, gpointer trans_pdata)
 {
diff --git a/libgnucash/engine/Transaction.c b/libgnucash/engine/Transaction.c
index e7b6ee82a..d24e96688 100644
--- a/libgnucash/engine/Transaction.c
+++ b/libgnucash/engine/Transaction.c
@@ -2060,25 +2060,6 @@ xaccTransSetDateEnteredSecs (Transaction *trans, time64 secs)
     xaccTransSetDateInternal(trans, &trans->date_entered, secs);
 }
 
-static void
-qofTransSetDatePosted (Transaction *trans, time64 time)
-{
-    if (!trans) return;
-    if (!qof_begin_edit(&trans->inst)) return;
-    xaccTransSetDateInternal(trans, &trans->date_posted, time);
-    set_gains_date_dirty(trans);
-    qof_commit_edit(&trans->inst);
-}
-
-static void
-qofTransSetDateEntered (Transaction *trans, time64 time)
-{
-    if (!trans) return;
-    if (!qof_begin_edit(&trans->inst)) return;
-    xaccTransSetDateInternal(trans, &trans->date_entered, time);
-    qof_commit_edit(&trans->inst);
-}
-
 void
 xaccTransSetDate (Transaction *trans, int day, int mon, int year)
 {
diff --git a/libgnucash/engine/gnc-optiondb.cpp b/libgnucash/engine/gnc-optiondb.cpp
index b62436d16..26d7f9f2c 100644
--- a/libgnucash/engine/gnc-optiondb.cpp
+++ b/libgnucash/engine/gnc-optiondb.cpp
@@ -265,55 +265,6 @@ GncOptionDB::make_internal(const char* section, const char* name)
         db_opt->make_internal();
 }
 
-static inline bool constexpr
-is_eol(char c)
-{
-    return c == '\n';
-}
-
-static inline bool constexpr
-is_whitespace(char c)
-{
-    return c == ' ' || c == '\n' || c == '\t';
-}
-
-static inline bool constexpr
-is_begin_paren(char c)
-{
-    return c == '(';
-}
-
-static inline bool constexpr
-is_end_paren(char c)
-{
-    return c == ')';
-}
-
-static inline bool constexpr
-is_double_quote(char c)
-{
-    return c == '"';
-}
-
-static inline bool constexpr
-is_single_quote(char c)
-{
-    return c == '\'';
-}
-
-static inline bool constexpr
-is_semicolon(char c)
-{
-    return c == ';';
-}
-
-static inline bool constexpr
-is_delim(char c)
-{
-    return is_begin_paren(c) || is_end_paren(c) || is_whitespace(c) ||
-        is_single_quote(c) || is_double_quote(c) || is_semicolon(c);
-}
-
 std::ostream&
 GncOptionDB::save_option_key_value(std::ostream& oss,
                                    const std::string& section,
diff --git a/libgnucash/engine/policy.c b/libgnucash/engine/policy.c
index fddd7ff57..3e4b05614 100644
--- a/libgnucash/engine/policy.c
+++ b/libgnucash/engine/policy.c
@@ -202,42 +202,5 @@ xaccGetFIFOPolicy (void)
     return pcy;
 }
 
-static GNCLot *
-LIFOPolicyGetLot (GNCPolicy *pcy, Split *split)
-{
-    if (!split) return NULL;
-    return xaccAccountFindLatestOpenLot (split->acc, split->amount,
-                                         split->parent->common_currency);
-}
-
-static Split *
-LIFOPolicyGetSplit (GNCPolicy *pcy, GNCLot *lot)
-{
-    return DirectionPolicyGetSplit (pcy, lot, 1);
-}
-
-/* This routine is actually identical to FIFO... */
-static void
-LIFOPolicyGetLotOpening (GNCPolicy *pcy,
-                         GNCLot *lot,
-                         gnc_numeric *ret_amount, gnc_numeric *ret_value,
-                         gnc_commodity **ret_currency)
-{
-    Split *opening_split;
-    opening_split = gnc_lot_get_earliest_split(lot);
-
-    if (ret_amount) *ret_amount = opening_split->amount;
-    if (ret_value) *ret_value = opening_split->value;
-    if (ret_currency) *ret_currency = opening_split->parent->common_currency;
-}
-
-/* This routine is actually identical to FIFO... */
-static gboolean
-LIFOPolicyIsOpeningSplit (GNCPolicy *pcy, GNCLot *lot, Split *split)
-{
-    Split *opening_split;
-    opening_split = gnc_lot_get_earliest_split(lot);
-    return (split == opening_split);
-}
 
 /* =========================== END OF FILE ======================= */
diff --git a/libgnucash/engine/qofobject.cpp b/libgnucash/engine/qofobject.cpp
index fed5ee58f..bb74b9155 100644
--- a/libgnucash/engine/qofobject.cpp
+++ b/libgnucash/engine/qofobject.cpp
@@ -272,12 +272,6 @@ const char * qof_object_get_type_label (QofIdTypeConst type_name)
     return (obj->type_label);
 }
 
-static gboolean clear_table (gpointer key, gpointer value, gpointer user_data)
-{
-    g_hash_table_destroy (static_cast<GHashTable*>(value));
-    return TRUE;
-}
-
 /* INITIALIZATION and PRIVATE FUNCTIONS */
 
 void qof_object_initialize (void)
diff --git a/libgnucash/engine/test-core/test-engine-stuff.cpp b/libgnucash/engine/test-core/test-engine-stuff.cpp
index cc490a035..05a2528e3 100644
--- a/libgnucash/engine/test-core/test-engine-stuff.cpp
+++ b/libgnucash/engine/test-core/test-engine-stuff.cpp
@@ -122,20 +122,6 @@ set_max_kvp_frame_elements (gint max_kvp_frame_elements)
     kvp_frame_max_elements = MAX (max_kvp_frame_elements, 1);
 }
 
-static void
-kvp_exclude_type (KvpValue::Type kvp_type)
-{
-    gint *key;
-
-    if (!exclude_kvp_types)
-        exclude_kvp_types = g_hash_table_new (g_int_hash, g_int_equal);
-
-    key = g_new (gint, 1);
-    *key = kvp_type;
-
-    g_hash_table_insert (exclude_kvp_types, key, exclude_kvp_types);
-}
-
 static gboolean
 kvp_type_excluded (KvpValue::Type kvp_type)
 {
@@ -1565,32 +1551,6 @@ get_random_queryop(void)
     return op;
 }
 
-static GSList *
-get_random_kvp_path (void)
-{
-    GSList *path;
-    gint len;
-
-    path = NULL;
-    len = get_random_int_in_range (1, kvp_max_depth);
-
-    while (len--)
-        path = g_slist_prepend (path, get_random_string_without ("\n\\"));
-
-    return g_slist_reverse (path);
-}
-
-static void
-free_random_kvp_path (GSList *path)
-{
-    GSList *node;
-
-    for (node = path; node; node = node->next)
-        g_free (node->data);
-
-    g_slist_free (path);
-}
-
 static QofIdType
 get_random_id_type (void)
 {
diff --git a/libgnucash/engine/test-core/test-engine-stuff.h b/libgnucash/engine/test-core/test-engine-stuff.h
index 54a47a1a4..b98825045 100644
--- a/libgnucash/engine/test-core/test-engine-stuff.h
+++ b/libgnucash/engine/test-core/test-engine-stuff.h
@@ -62,7 +62,6 @@ KvpFrame* get_random_kvp_frame(void);
 gnc_numeric get_random_gnc_numeric(int64_t);
 GncGUID* get_random_guid(void);
 
-//void kvp_exclude_type (KvpValueType kvp_type);
 void set_max_kvp_depth (gint max_kvp_depth);
 void set_max_kvp_frame_elements (gint max_kvp_frame_elements);
 void set_max_account_tree_depth (gint max_tree_depth);
diff --git a/libgnucash/engine/test/test-gnc-date.c b/libgnucash/engine/test/test-gnc-date.c
index 4a386b733..93c379e0c 100644
--- a/libgnucash/engine/test/test-gnc-date.c
+++ b/libgnucash/engine/test/test-gnc-date.c
@@ -61,18 +61,6 @@ typedef struct
     time64 t5;
 } FixtureA;
 
-static int
-offset_secs (TZOffset tz)
-{
-    return 3600 * tz.hours + 60 * tz.minutes;
-}
-
-static char*
-offset_string (TZOffset tz)
-{
-    return g_strdup_printf("%+02d%02d", tz.hours, tz.minutes);
-}
-
 static void setup (FixtureA *f, gconstpointer pData)
 {
     f->t0 = gnc_time(NULL);
@@ -1348,15 +1336,6 @@ test_gnc_date_timestamp (void)
 
     g_free (timestr);
 }
-/* gnc_iso8601_to_time64_gmt
-time64
-gnc_iso8601_to_time64_gmt(const char *str)// C: 6 in 3  Local: 0:0:0
-*/
-static gint
-get_nanoseconds (GDateTime *gdt)
-{
-    return g_date_time_get_microsecond (gdt) * 1000;
-}
 
 static void
 test_gnc_iso8601_to_time64_gmt (FixtureA *f, gconstpointer pData)
@@ -1382,18 +1361,6 @@ test_gnc_iso8601_to_time64_gmt (FixtureA *f, gconstpointer pData)
     t = gnc_iso8601_to_time64_gmt ("2061-01-25 23:21:19.0 -05:00");
     g_assert_cmpint (t, ==, f->t5);
 }
-/* gnc_time64_to_iso8601_buff
-char *
-gnc_time64_to_iso8601_buff (time64 t, char * buff)// C: 18 in 7  Local: 0:0:0
-*/
-static time64
-g_date_time_to_time64 (GDateTime *gdt)
-{
-    time64 t;
-    t = g_date_time_to_unix (gdt);
-    return t;
-}
-
 #define ISO8601_SIZE MAX_DATE_LENGTH + 4
 static gchar*
 format_timestring (time64 t, TZOffset tz)
@@ -1536,22 +1503,6 @@ test_gnc_dmy2time64_end (FixtureB *f, gconstpointer pData)
     g_log_set_default_handler (hdlr, 0);
 }
 
-static GDateTime*
-offset_adjust(GDateTime *gdt)
-{
-     Testfuncs *tf = gnc_date_load_funcs();
-     GTimeZone *zone = tf->timezone_new_local();
-     int interval = g_time_zone_find_interval(zone, G_TIME_TYPE_STANDARD,
-					      g_date_time_to_unix(gdt));
-     int offset = g_time_zone_get_offset(zone, interval) / 60;
-     int off_hr = (offset / 60) + (offset % 60 ? (offset < 0 ? -1 : 1) : 0);
-     int correction = off_hr < -10 ? -10 - off_hr : off_hr > 13 ? 13 - off_hr : 0;
-     GDateTime* new_gdt = g_date_time_add_hours(gdt, correction);
-     g_date_time_unref(gdt);
-     g_slice_free(Testfuncs, tf);
-     return new_gdt;
-}
-
 /*gnc_dmy2time64_neutral*/
 static void
 test_gnc_dmy2time64_neutral (FixtureB *f, gconstpointer pData)
diff --git a/libgnucash/engine/test/test-qofinstance.cpp b/libgnucash/engine/test/test-qofinstance.cpp
index a40aecc45..aa5a4031c 100644
--- a/libgnucash/engine/test/test-qofinstance.cpp
+++ b/libgnucash/engine/test/test-qofinstance.cpp
@@ -431,15 +431,6 @@ test_instance_display_name( Fixture *fixture, gconstpointer pData )
     qof_collection_destroy( col );
 }
 
-static void
-mock_backend_begin( QofBackend *be, QofInstance *inst )
-{
-    g_assert( be );
-    g_assert( inst );
-    g_assert_cmpstr( inst->e_type, == , "test type" );
-    is_called = TRUE;
-}
-
 static void
 test_instance_begin_edit( Fixture *fixture, gconstpointer pData )
 {
diff --git a/libgnucash/engine/test/test-qofsession.cpp b/libgnucash/engine/test/test-qofsession.cpp
index d292fa38b..30d91e297 100644
--- a/libgnucash/engine/test/test-qofsession.cpp
+++ b/libgnucash/engine/test/test-qofsession.cpp
@@ -34,7 +34,6 @@ static QofBook * exported_book {nullptr};
 static bool safe_sync_called {false};
 static bool sync_called {false};
 static bool load_error {true};
-static bool hook_called {false};
 static bool data_loaded {false};
 
 class QofSessionMockBackend : public QofBackend
@@ -52,12 +51,6 @@ public:
     void export_coa(QofBook*);
 };
 
-static void
-example_hook (QofSession & session)
-{
-    hook_called = true;
-}
-
 void QofSessionMockBackend::load (QofBook *book, QofBackendLoadType)
 {
     if (load_error)

commit 05975aa5102077ab478485162638d9e9da1e5f2b
Author: Richard Cohen <richard at daijobu.co.uk>
Date:   Sat Jan 28 16:00:00 2023 +0000

    [-Wunused-function] - remove commented out reduce_tests() and dependents

diff --git a/borrowed/jenny/jenny.c b/borrowed/jenny/jenny.c
index d3ed6ef1e..90b1ae2ae 100644
--- a/borrowed/jenny/jenny.c
+++ b/borrowed/jenny/jenny.c
@@ -1645,101 +1645,6 @@ cover_tuples( state *s)
   my_free((char *)curr_test);
 }
 
-static void
-prepare_reduce( state *s)
-{
-  feature tuple[MAX_N];
-  ub1     n = s->n_final;
-  ub4     t, d;
-
-  for (t=0; t<s->ntests; ++t) {
-    for (d=0; d<s->ndim; ++d) {
-      s->onec[t][d] = 0;
-    }
-  }
-
-  /* Iterate through all the tuples */
-  start_builder( s, tuple, n);
-
-  for (;;) {
-    sb4 i;
-    ub2 thistest;
-
-    for (i=0; i<n; ++i) {
-      s->tuple_tester->f[tuple[i].d] = tuple[i].f;
-    }
-    if (count_withouts(s->tuple_tester, s->wc2) ||
-        count_withouts(s->tuple_tester, s->wc3))
-      goto make_next_tuple;
-
-    for (i=0; i<s->ntests; ++i) {
-      ub1 j;
-      for (j=0; j<n; ++j)
-        if (s->t[i]->f[tuple[j].d] != tuple[j].f)
-          break;
-      if (j == n)
-        break;                              /* this test contains this tuple */
-    }
-
-    /* no tests cover this tuple */
-    if (i==s->ntests) {
-      printf("error: some tuple not covered at all\n");
-    } else {
-      thistest = i;
-      for (++i; i<s->ntests; ++i) {
-        ub1 j;
-        for (j=0; j<n; ++j)
-          if (s->t[i]->f[tuple[j].d] != tuple[j].f)
-            break;
-        if (j == n)
-          break;                            /* this test contains this tuple */
-      }
-      if (i == s->ntests) {
-        ub1 j;
-        for (j=0; j<n; ++j) {
-          tu_iter ctx;
-          (void)start_tuple(&ctx, &s->one[thistest][tuple[j].d], n,
-                            &s->onec[thistest][tuple[j].d]);
-          (void)insert_tuple(s, &ctx, tuple);
-        }
-      }
-    }
-
-  make_next_tuple:
-    for (i=0; i<n; ++i) {
-      s->tuple_tester->f[tuple[i].d] = (ub2)~0;
-    }
-    if (!next_builder( s, tuple, n))
-      break;
-  }
-}
-
-/* find a test to try to eliminate */
-static int
-which_test( state *s)
-{
-  ub4 t;
-  ub4 mincount = ~0;
-  ub4 mint = 0;                  /* test with the fewest once-covered tuples */
-  for (t=0; t<s->ntests; ++t) {
-    ub4 i, j=0;
-    for (i=0; i<s->ndim; ++i) {
-      j += s->onec[t][i];
-    }
-    if (j <= mincount) {
-      mincount = j;
-      mint = t;
-    }
-  }
-  return mint;
-}
-
-static void
-reduce_tests( state *s)
-{
-  prepare_reduce( s);
-}
-
 /* Confirm that every tuple is covered by either a testcase or a without */
 static int
 confirm( state *s)
@@ -1818,7 +1723,6 @@ driver( int argc, char *argv[])
 
   if (parse(argc, argv, &s)) {               /* read the user's instructions */
     cover_tuples(&s);     /* generate testcases until all tuples are covered */
-    /* reduce_tests(&s); */         /* try to reduce the number of testcases */
     if (confirm(&s))       /* doublecheck that all tuples really are covered */
       report_all(&s);                                  /* report the results */
     else

commit f702709422bf21c1c868cf2324bd18344d035e8e
Author: Richard Cohen <richard at daijobu.co.uk>
Date:   Sat Jan 28 17:32:58 2023 +0000

    [-Wunused-function] - make glade callbacks public

diff --git a/gnucash/import-export/aqb/dialog-ab-trans.c b/gnucash/import-export/aqb/dialog-ab-trans.c
index 04776061a..6853a90a9 100644
--- a/gnucash/import-export/aqb/dialog-ab-trans.c
+++ b/gnucash/import-export/aqb/dialog-ab-trans.c
@@ -66,26 +66,27 @@ static GNC_AB_JOB *gnc_ab_trans_dialog_get_available_empty_job(GNC_AB_ACCOUNT_SP
 static void gnc_ab_trans_dialog_check_iban(const GncABTransDialog *td,
         const AB_TRANSACTION *trans);
 
-/* Callbacks - connected with GtkBuilder */
-static void gnc_ab_trans_dialog_add_templ_cb(GtkButton *button, gpointer user_data);
-static void gnc_ab_trans_dialog_moveup_templ_cb(GtkButton *button, gpointer user_data);
-static void gnc_ab_trans_dialog_movedown_templ_cb(GtkButton *button, gpointer user_data);
-static void gnc_ab_trans_dialog_sort_templ_cb(GtkButton *button, gpointer user_data);
-static void gnc_ab_trans_dialog_del_templ_cb(GtkButton *button, gpointer user_data);
-static void gnc_ab_trans_dialog_ibanentry_filter_cb (GtkEditable *editable,
+/* Callbacks - connected with GtkBuilder - so should not be static */
+void gnc_ab_trans_dialog_add_templ_cb(GtkButton *button, gpointer user_data);
+void gnc_ab_trans_dialog_moveup_templ_cb(GtkButton *button, gpointer user_data);
+void gnc_ab_trans_dialog_movedown_templ_cb(GtkButton *button, gpointer user_data);
+void gnc_ab_trans_dialog_sort_templ_cb(GtkButton *button, gpointer user_data);
+void gnc_ab_trans_dialog_del_templ_cb(GtkButton *button, gpointer user_data);
+void gnc_ab_trans_dialog_ibanentry_filter_cb (GtkEditable *editable,
         const gchar *text,
         gint         length,
         gint        *position,
         gpointer     user_data);
-static void gnc_ab_trans_dialog_bicentry_filter_cb (GtkEditable *editable,
+void gnc_ab_trans_dialog_bicentry_filter_cb (GtkEditable *editable,
         const gchar *text,
         gint         length,
         gint        *position,
         gpointer     user_data);
-static void gnc_ab_trans_dialog_templ_list_row_activated_cb(GtkTreeView *view,
+void gnc_ab_trans_dialog_templ_list_row_activated_cb(GtkTreeView *view,
         GtkTreePath *path,
         GtkTreeViewColumn *column,
         gpointer user_data);
+
 static void gnc_ab_trans_dialog_verify_values(GncABTransDialog *td);
 
 

commit 1204083fdcefdbd8d2d5335de1551acfa7a58013
Author: Richard Cohen <richard at daijobu.co.uk>
Date:   Mon Feb 13 14:58:11 2023 +0000

    [-Wunused-variable] - mark window limit as potentially unused (only on Mac)

diff --git a/gnucash/gnome-utils/gnc-main-window.cpp b/gnucash/gnome-utils/gnc-main-window.cpp
index 9af1c68b8..0e1b0970f 100644
--- a/gnucash/gnome-utils/gnc-main-window.cpp
+++ b/gnucash/gnome-utils/gnc-main-window.cpp
@@ -133,7 +133,7 @@ enum
 extern gboolean gnc_book_options_dialog_apply_helper(GncOptionDB * options);
 
 /** Max number of windows allowed */
-constexpr auto gnc_main_window_max_number {10};
+[[maybe_unused]] constexpr auto gnc_main_window_max_number {10};
 
 /* Static Globals *******************************************************/
 

commit 0aad5696793d98f858847b9c795db9b6b0fc4e17
Author: Richard Cohen <richard at daijobu.co.uk>
Date:   Mon Feb 13 14:44:51 2023 +0000

    [-Wunused-variable] - mark QofLogModule as unused

diff --git a/gnucash/gnome-utils/gnc-report-combo.c b/gnucash/gnome-utils/gnc-report-combo.c
index a61bf8066..717e52776 100644
--- a/gnucash/gnome-utils/gnc-report-combo.c
+++ b/gnucash/gnome-utils/gnc-report-combo.c
@@ -32,7 +32,7 @@
 #include "dialog-utils.h"
 
 /** The debugging module used by this file. */
-static QofLogModule log_module = GNC_MOD_GUI;
+__attribute__((unused)) static QofLogModule log_module = GNC_MOD_GUI;
 
 static void gnc_report_combo_init       (GncReportCombo      *grc);
 static void gnc_report_combo_class_init (GncReportComboClass *klass);

commit 083166b5ffc42a34dc54f4f0b375063521a014ef
Author: Richard Cohen <richard at daijobu.co.uk>
Date:   Mon Feb 13 15:01:58 2023 +0000

    [-Wunused-variable] - move into the #ifdef where it is used

diff --git a/gnucash/register/register-gnome/gnucash-sheet.c b/gnucash/register/register-gnome/gnucash-sheet.c
index 15d65a7f0..0222e96ee 100644
--- a/gnucash/register/register-gnome/gnucash-sheet.c
+++ b/gnucash/register/register-gnome/gnucash-sheet.c
@@ -1375,7 +1375,6 @@ gnucash_scroll_event (GtkWidget *widget, GdkEventScroll *event)
     GnucashSheet *sheet;
     GtkAdjustment *vadj;
     gfloat h_value, v_value;
-    int direction;
 
     g_return_val_if_fail (widget != NULL, TRUE);
     g_return_val_if_fail (GNUCASH_IS_SHEET(widget), TRUE);
@@ -1406,7 +1405,7 @@ gnucash_scroll_event (GtkWidget *widget, GdkEventScroll *event)
 #if defined MAC_INTEGRATION
         v_value += event->delta_y;
 #else
-        direction = event->delta_y > 0 ? 1 : event->delta_y < 0 ? -1 : 0;
+        int direction = event->delta_y > 0 ? 1 : event->delta_y < 0 ? -1 : 0;
         v_value += gtk_adjustment_get_step_increment (vadj) * direction;
 #endif
         break;

commit 4eb022c7a2d5d521b8c04bf22b5b3bd43ac4afc0
Author: Richard Cohen <richard at daijobu.co.uk>
Date:   Mon Jan 30 13:11:11 2023 +0000

    [-Wunused-variable] - remove

diff --git a/gnucash/gnome-utils/gnc-option-gtk-ui.cpp b/gnucash/gnome-utils/gnc-option-gtk-ui.cpp
index d239b34bd..eebc9a106 100644
--- a/gnucash/gnome-utils/gnc-option-gtk-ui.cpp
+++ b/gnucash/gnome-utils/gnc-option-gtk-ui.cpp
@@ -1771,13 +1771,11 @@ public:
         if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(px_button)))
         {
             option.set_alternate(false);
-            auto spin{g_list_nth_data(widgets, 1)};
             option.set_value(gtk_spin_button_get_value(GTK_SPIN_BUTTON(get_widget())));
         }
         else
         {
             option.set_alternate(true);
-            auto spin{g_list_nth_data(widgets, 3)};
             option.set_value(gtk_spin_button_get_value(GTK_SPIN_BUTTON(get_widget())));
         }
     }
diff --git a/gnucash/gnome-utils/gnc-report-combo.c b/gnucash/gnome-utils/gnc-report-combo.c
index 18621e108..a61bf8066 100644
--- a/gnucash/gnome-utils/gnc-report-combo.c
+++ b/gnucash/gnome-utils/gnc-report-combo.c
@@ -119,7 +119,6 @@ static void
 gnc_report_combo_class_init (GncReportComboClass *klass)
 {
     GObjectClass   *object_class = G_OBJECT_CLASS(klass);
-    GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
 
     object_class->get_property = gnc_report_combo_get_property;
     object_class->dispose  = gnc_report_combo_dispose;
@@ -237,7 +236,6 @@ select_active_and_check_exists (GncReportCombo *grc)
     GtkTreeModel *model = gtk_combo_box_get_model (GTK_COMBO_BOX(priv->combo));
     GtkTreeIter iter;
     gboolean valid_iter = gtk_tree_model_get_iter_first (model, &iter);
-    QofBook *book = gnc_get_current_book ();
     gchar *tmp;
 
     while (valid_iter)
@@ -446,7 +444,6 @@ gboolean
 gnc_report_combo_is_warning_visible_for_active (GncReportCombo *grc)
 {
     GncReportComboPrivate *priv;
-    gboolean missing = FALSE;
 
     g_return_val_if_fail (grc != NULL, FALSE);
     g_return_val_if_fail (GNC_IS_REPORT_COMBO(grc), FALSE);
diff --git a/gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp b/gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp
index 81ca20076..25675f720 100644
--- a/gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp
+++ b/gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp
@@ -229,7 +229,6 @@ void GncPreTrans::set (GncTransPropType prop_type, const std::string& value)
         // Drop any existing error for the prop_type we're about to set
         m_errors.erase(prop_type);
 
-        gnc_commodity *comm = nullptr;
         switch (prop_type)
         {
             case GncTransPropType::UNIQUE_ID:
@@ -397,7 +396,6 @@ bool GncPreTrans::is_multi_currency()
 
 void GncPreSplit::UpdateCrossSplitCounters ()
 {
-    auto acct = static_cast<Account *> (nullptr);
     if (m_account && *m_account)
     {
         auto acct = *m_account;
diff --git a/gnucash/import-export/import-main-matcher.c b/gnucash/import-export/import-main-matcher.c
index f35b775e8..f261c0a3a 100644
--- a/gnucash/import-export/import-main-matcher.c
+++ b/gnucash/import-export/import-main-matcher.c
@@ -1047,7 +1047,6 @@ gnc_gen_trans_set_price_to_selection_cb (GtkMenuItem *menuitem,
 
     GtkTreeView *treeview = GTK_TREE_VIEW(info->view);
     GtkTreeModel *model = gtk_tree_view_get_model (treeview);
-    GtkTreeStore *store  = GTK_TREE_STORE (model);
     GtkTreeSelection *selection = gtk_tree_view_get_selection (treeview);
     GList *selected_rows = gtk_tree_selection_get_selected_rows (selection, &model);
 
@@ -1065,9 +1064,7 @@ gnc_gen_trans_set_price_to_selection_cb (GtkMenuItem *menuitem,
         time64 post_date = xaccTransGetDate(trans);
         Split *split = gnc_import_TransInfo_get_fsplit (row->trans_info);
         Account *src_acc = xaccSplitGetAccount (split);
-        gnc_commodity *trans_curr = xaccTransGetCurrency (trans);
         Account *dest_acc = gnc_import_TransInfo_get_destacc (row->trans_info);
-        gnc_commodity *acc_comm = xaccAccountGetCommodity (dest_acc);
         gnc_numeric dest_value = gnc_import_TransInfo_get_dest_value (row->trans_info);
 
         XferDialog *xfer = gnc_xfer_dialog(GTK_WIDGET (info->main_widget), src_acc);
diff --git a/libgnucash/core-utils/gnc-filepath-utils.cpp b/libgnucash/core-utils/gnc-filepath-utils.cpp
index a362246c1..c613640c3 100644
--- a/libgnucash/core-utils/gnc-filepath-utils.cpp
+++ b/libgnucash/core-utils/gnc-filepath-utils.cpp
@@ -500,7 +500,6 @@ get_user_data_dir ()
 static bfs::path
 get_user_data_dir()
 {
-    char *retval = NULL;
     NSFileManager*fm = [NSFileManager defaultManager];
     NSArray* appSupportDir = [fm URLsForDirectory:NSApplicationSupportDirectory
     inDomains:NSUserDomainMask];

commit 8a20bcadb079259fe76109908e91ef95e21ce17d
Author: Richard Cohen <richard at daijobu.co.uk>
Date:   Tue Jan 24 18:03:05 2023 +0000

    [-Wunused-variable] - remove unused translatable string

diff --git a/libgnucash/app-utils/gnc-quotes.cpp b/libgnucash/app-utils/gnc-quotes.cpp
index ab46fc05d..e834089b3 100644
--- a/libgnucash/app-utils/gnc-quotes.cpp
+++ b/libgnucash/app-utils/gnc-quotes.cpp
@@ -772,8 +772,6 @@ show_gnucash_quote(const bpt::ptree& comm_pt)
     const char* rec{C_("Finance::Quote", "recommended")};
     //Translators: Means that one of the indicated elements is required
     const char* oot{C_("Finance::Quote", "one of these")};
-    //Translators: Means that the preceding element is optional
-    const char* opt{C_("Finance::Quote", "optional")};
     //Translators: Means that a required element wasn't reported. The *s are for emphasis.
     const char* miss{C_("Finance::Quote", "**missing**")};
 

commit 56d950598d65e56f1462038967886b0ec7a50c07
Author: Richard Cohen <richard at daijobu.co.uk>
Date:   Sat Jan 28 17:31:50 2023 +0000

    [-Wunused-variable] - pretend to use
    
    Looks like a SWIG bug, creating an extra variable that it doesn't use
    
    bindings/python/gnucash_core.c: In function ‘_wrap_xaccAccountGetReconcileLastDate’:
    bindings/python/gnucash_core.c:10096:10: warning: unused variable ‘secs20’ [-Wunused-variable]
    10096 |   time64 secs20 ;
          |          ^~~~~~
    bindings/python/gnucash_core.c: In function ‘_wrap_xaccAccountGetReconcilePostponeDate’:
    bindings/python/gnucash_core.c:10298:10: warning: unused variable ‘secs20’ [-Wunused-variable]
    10298 |   time64 secs20 ;
          |          ^~~~~~
    bindings/python/gnucash_core.c: In function ‘_wrap_qof_query_date_predicate_get_date’:
    bindings/python/gnucash_core.c:20237:10: warning: unused variable ‘secs20’ [-Wunused-variable]
    20237 |   time64 secs20 ;
          |          ^~~~~~

diff --git a/bindings/python/time64.i b/bindings/python/time64.i
index cf3408a98..93d9f261f 100644
--- a/bindings/python/time64.i
+++ b/bindings/python/time64.i
@@ -137,6 +137,10 @@
   PyObject *tp;
   struct tm t;
 
+  // SWIG 4.02 (maybe others?) generates a redundant variable "time64 secs20"
+  // This line avoids the unused-variable warning
+  (void) secs;
+
   // directly access return value (result) of function
   // only return datetime if TRUE
   if(result) {

commit f63dddcc8483f3e273ffc4faf0cfa0c7b4f329d9
Author: Richard Cohen <richard at daijobu.co.uk>
Date:   Mon Feb 13 16:48:42 2023 +0000

    [-Wunused-but-set-variable] (clang) - remove

diff --git a/borrowed/jenny/jenny.c b/borrowed/jenny/jenny.c
index 2b2d3c63a..d3ed6ef1e 100644
--- a/borrowed/jenny/jenny.c
+++ b/borrowed/jenny/jenny.c
@@ -1184,7 +1184,6 @@ build_tuples( state *s, ub2 d, ub2 f)
   feature  offset[MAX_N];                                      /* n-1-tuples */
   feature  tuple[MAX_N];                      /* n-tuples that include (d,f) */
   sb4      i, j, n;
-  ub8      count = 0;
   tu_iter  ctx;
 
   if (s->tc[d][f] > 0 || s->n[d][f] == s->n_final) {
@@ -1242,7 +1241,6 @@ build_tuples( state *s, ub2 d, ub2 f)
       printf("jenny: could not insert tuple\n");
       return;
     }
-    ++count;
 
     /* next tuple */
   make_next_tuple:
diff --git a/gnucash/gnome-utils/gnc-query-view.c b/gnucash/gnome-utils/gnc-query-view.c
index 88b8d21a1..4d0528168 100644
--- a/gnucash/gnome-utils/gnc-query-view.c
+++ b/gnucash/gnome-utils/gnc-query-view.c
@@ -808,7 +808,6 @@ gnc_query_view_fill (GNCQueryView *qview)
     for (item = entries; item; item = item->next)
     {
         GList *node;
-        gint row = 0;
         const QofParam *gup;
         QofParam *qp = NULL;
 
@@ -868,7 +867,6 @@ gnc_query_view_fill (GNCQueryView *qview)
             }
             i++;
         }
-        row++;
         /* and set a watcher on this item */
         gup = priv->get_guid;
         guid = (const GncGUID*)((gup->param_getfcn)(item->data, gup));
diff --git a/gnucash/gnome-utils/gnc-tree-view-account.c b/gnucash/gnome-utils/gnc-tree-view-account.c
index 1939cab61..b7fb5d3f1 100644
--- a/gnucash/gnome-utils/gnc-tree-view-account.c
+++ b/gnucash/gnome-utils/gnc-tree-view-account.c
@@ -1221,24 +1221,12 @@ gnc_tree_view_account_get_view_info (GncTreeViewAccount *account_view,
 /*
  * Set the account view info data in use by the specified tree to
  * match the callers request.
- *
- * DRH - COMPATIBILITY WARNING
- *
- * This function does not do anything with the 'include_type' field.
- * Should there be a automatic filter for backward compatibility
- * that uses these flags, or should all uses of this be converted to
- * a GtkTreeModelFilter?
- *
- * CAS - For now, I'll try the automatic filter approach by making
- * this function use GtkTreeModelFilter.
  */
 void
 gnc_tree_view_account_set_view_info (GncTreeViewAccount *account_view,
                                      AccountViewInfo *avi)
 {
     GncTreeViewAccountPrivate *priv;
-    gint i;
-    guint sel_bits = 0;
 
     ENTER("%p", account_view);
     g_return_if_fail(GNC_IS_TREE_VIEW_ACCOUNT(account_view));
@@ -1247,11 +1235,6 @@ gnc_tree_view_account_set_view_info (GncTreeViewAccount *account_view,
     priv = GNC_TREE_VIEW_ACCOUNT_GET_PRIVATE(account_view);
     priv->avi = *avi;
 
-    for (i = 0; i < NUM_ACCOUNT_TYPES; i++)
-    {
-        sel_bits |= avi->include_type[i] ? (1 << i) : 0;
-    }
-
     gnc_tree_view_account_set_filter(
         account_view, gnc_tree_view_account_filter_by_view_info,
         &priv->avi, NULL);
diff --git a/gnucash/gnome/business-gnome-utils.c b/gnucash/gnome/business-gnome-utils.c
index c65028d2c..55b437aca 100644
--- a/gnucash/gnome/business-gnome-utils.c
+++ b/gnucash/gnome/business-gnome-utils.c
@@ -154,7 +154,7 @@ gnc_default_invoice_report_combo (const char* guid_scm_function)
 
     if (scm_is_list (rpt_guids))
     {
-        for (int i = 0; !scm_is_null (rpt_guids); i++)
+        while (!scm_is_null (rpt_guids))
         {
             gchar *guid_str = scm_to_utf8_string (SCM_CAR(rpt_guids));
             gchar *name = gnc_scm_to_utf8_string (scm_call_2(template_menu_name,
diff --git a/gnucash/gnome/dialog-custom-report.c b/gnucash/gnome/dialog-custom-report.c
index 5436c46ba..2aa4af39b 100644
--- a/gnucash/gnome/dialog-custom-report.c
+++ b/gnucash/gnome/dialog-custom-report.c
@@ -155,7 +155,6 @@ update_report_list(GtkListStore *store, CustomReportDialog *crd)
     SCM get_rpt_guids = scm_c_eval_string("gnc:custom-report-template-guids");
     SCM template_menu_name = scm_c_eval_string("gnc:report-template-menu-name/report-guid");
     SCM rpt_guids;
-    int i;
     GtkTreeIter iter;
     GtkTreeModel *model = GTK_TREE_MODEL (store);
 
@@ -170,7 +169,7 @@ update_report_list(GtkListStore *store, CustomReportDialog *crd)
     {
         /* for all the report guids in the list, store them, with a reference,
              in the gtkliststore */
-        for (i = 0; !scm_is_null(rpt_guids); i++)
+        while ( !scm_is_null(rpt_guids) )
         {
             GncGUID *guid = guid_malloc ();
             gchar *guid_str = scm_to_utf8_string (SCM_CAR(rpt_guids));
diff --git a/gnucash/import-export/log-replay/gnc-log-replay.c b/gnucash/import-export/log-replay/gnc-log-replay.c
index f40e287d3..68244a4b5 100644
--- a/gnucash/import-export/log-replay/gnc-log-replay.c
+++ b/gnucash/import-export/log-replay/gnc-log-replay.c
@@ -365,7 +365,6 @@ static void  process_trans_record(  FILE *log_file)
     const char * record_end_str = "===== END";
     int first_record = TRUE;
     int record_ended = FALSE;
-    int split_num = 0;
     split_record record;
     Transaction * trans = NULL;
     Split * split = NULL;
@@ -380,7 +379,6 @@ static void  process_trans_record(  FILE *log_file)
         if (read_retval != NULL &&
             strncmp(record_end_str, read_buf, strlen(record_end_str)) != 0) /* If we are not at the end of the record */
         {
-            split_num++;
             /*DEBUG("process_trans_record(): Line read: %s%s",read_buf ,"\n");*/
 
             record = interpret_split_record(g_strchomp(read_buf));

commit dda1bb837407173c23374c6ed09bc3553fd6620c
Author: Richard Cohen <richard at daijobu.co.uk>
Date:   Thu Jan 26 17:45:34 2023 +0000

    [-Wunused-but-set-variable] (clang) - use

diff --git a/gnucash/import-export/test/test-import-pending-matches.cpp b/gnucash/import-export/test/test-import-pending-matches.cpp
index c633f256a..d98c56f8f 100644
--- a/gnucash/import-export/test/test-import-pending-matches.cpp
+++ b/gnucash/import-export/test/test-import-pending-matches.cpp
@@ -129,4 +129,6 @@ main (int argc, char *argv[])
     result =  g_test_run();
 
     qof_close();
+
+    return result;
 }

commit fe57fc41838ebec188bdb3b3b76319879438df6e
Author: Richard Cohen <richard at daijobu.co.uk>
Date:   Mon Feb 13 16:42:10 2023 +0000

    [-Wunused-but-set-variable] - remove

diff --git a/gnucash/gnome-utils/gnc-gtk-utils.c b/gnucash/gnome-utils/gnc-gtk-utils.c
index 4aad7bea4..ef264b0c5 100644
--- a/gnucash/gnome-utils/gnc-gtk-utils.c
+++ b/gnucash/gnome-utils/gnc-gtk-utils.c
@@ -771,7 +771,6 @@ gnc_menubar_model_update_item (GMenuModel *menu_model, const gchar *action_name,
         GVariant *value;
         GVariant *old_target = NULL;
         const gchar *old_action = NULL;
-        const gchar *old_label = NULL;
         const gchar *old_temp = NULL;
         const gchar *old_accel = NULL;
         GMenuItem *item;
@@ -782,9 +781,6 @@ gnc_menubar_model_update_item (GMenuModel *menu_model, const gchar *action_name,
             if (g_str_equal (key, GNC_MENU_ATTRIBUTE_TEMPORARY) &&
                 g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
                 old_temp = g_variant_get_string (value, NULL);
-            else if (g_str_equal (key, G_MENU_ATTRIBUTE_LABEL) &&
-                     g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
-                old_label = g_variant_get_string (value, NULL);
             else if (g_str_equal (key, G_MENU_ATTRIBUTE_ACTION) &&
                      g_variant_is_of_type (value, G_VARIANT_TYPE_STRING))
                 old_action = g_variant_get_string (value, NULL);
diff --git a/gnucash/gnome-utils/gnc-main-window.cpp b/gnucash/gnome-utils/gnc-main-window.cpp
index e2a921bdc..9af1c68b8 100644
--- a/gnucash/gnome-utils/gnc-main-window.cpp
+++ b/gnucash/gnome-utils/gnc-main-window.cpp
@@ -1834,7 +1834,6 @@ gnc_main_window_update_one_menu_action (GncMainWindow *window,
 static void
 gnc_main_window_update_radio_button (GncMainWindow *window)
 {
-    GncMainWindowPrivate *priv;
     GAction *action;
     gsize index;
 
@@ -1849,8 +1848,6 @@ gnc_main_window_update_radio_button (GncMainWindow *window)
         return;
     }
 
-    priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
-
     action = g_action_map_lookup_action (G_ACTION_MAP(window),
                                          "WindowAction");
 
@@ -2456,7 +2453,6 @@ main_window_update_page_set_read_only_icon (GncPluginPage *page,
                                             gboolean read_only)
 {
     GncMainWindow *window;
-    GncMainWindowPrivate *priv;
     GtkWidget *tab_widget;
     GtkWidget *image = NULL;
     GList *children;
@@ -2474,7 +2470,6 @@ main_window_update_page_set_read_only_icon (GncPluginPage *page,
 
     /* Get the notebook tab widget */
     main_window_find_tab_widget (window, page, &tab_widget);
-    priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
 
     if (!tab_widget)
     {
@@ -3463,7 +3458,6 @@ gnc_main_window_merge_actions (GncMainWindow *window,
                                const gchar *ui_filename,
                                gpointer user_data)
 {
-    GncMainWindowPrivate *priv;
     GncMainWindowActionData *data;
     GSimpleActionGroup *simple_action_group;
 
@@ -3476,8 +3470,6 @@ gnc_main_window_merge_actions (GncMainWindow *window,
     data->window = window;
     data->data = user_data;
 
-    priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
-
     simple_action_group = g_simple_action_group_new ();
 
     g_action_map_add_action_entries (G_ACTION_MAP(simple_action_group),
@@ -3511,14 +3503,11 @@ gnc_main_window_unmerge_actions (GncMainWindow *window,
 GAction *
 gnc_main_window_find_action (GncMainWindow *window, const gchar *action_name)
 {
-    GncMainWindowPrivate *priv;
     GAction *action = nullptr;
 
     g_return_val_if_fail (GNC_IS_MAIN_WINDOW(window), nullptr);
     g_return_val_if_fail (action_name != nullptr, nullptr);
 
-    priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
-
     action = g_action_map_lookup_action (G_ACTION_MAP(window),
                                          action_name);
 
diff --git a/gnucash/gnome-utils/gnc-plugin-page.c b/gnucash/gnome-utils/gnc-plugin-page.c
index 43e8ab1d4..54348e6c7 100644
--- a/gnucash/gnome-utils/gnc-plugin-page.c
+++ b/gnucash/gnome-utils/gnc-plugin-page.c
@@ -854,7 +854,6 @@ gnc_plugin_page_main_window_changed (GtkWindow *window,
 {
     GncPluginPage *current_plugin_page = GNC_PLUGIN_PAGE(object);
     GncPluginPage *plugin_page = GNC_PLUGIN_PAGE(user_data);
-    GncPluginPagePrivate *priv;
     gboolean on_current_page = FALSE;
 
     // Continue if current_plugin_page is valid
@@ -865,8 +864,6 @@ gnc_plugin_page_main_window_changed (GtkWindow *window,
     if (!plugin_page || !GNC_IS_PLUGIN_PAGE(plugin_page))
         return;
 
-    priv = GNC_PLUGIN_PAGE_GET_PRIVATE(plugin_page);
-
     if (current_plugin_page == plugin_page)
         on_current_page = TRUE;
 
diff --git a/gnucash/gnome-utils/gnc-report-combo.c b/gnucash/gnome-utils/gnc-report-combo.c
index 3897dfbe1..18621e108 100644
--- a/gnucash/gnome-utils/gnc-report-combo.c
+++ b/gnucash/gnome-utils/gnc-report-combo.c
@@ -425,13 +425,9 @@ void
 gnc_report_combo_set_active_guid_name (GncReportCombo *grc,
                                        const gchar *guid_name)
 {
-    GncReportComboPrivate *priv;
-
     g_return_if_fail (grc != NULL);
     g_return_if_fail (GNC_IS_REPORT_COMBO(grc));
 
-    priv = GET_PRIVATE(grc);
-
     if (guid_name && *guid_name)
     {
         gchar *guid = NULL;
diff --git a/gnucash/gnome-utils/gnc-tree-view.c b/gnucash/gnome-utils/gnc-tree-view.c
index 994dbdf34..0e48e3b84 100644
--- a/gnucash/gnome-utils/gnc-tree-view.c
+++ b/gnucash/gnome-utils/gnc-tree-view.c
@@ -1413,9 +1413,7 @@ void gnc_tree_view_expand_columns (GncTreeView *view,
                                    gchar *first_column_name,
                                    ...)
 {
-    GncTreeViewPrivate *priv;
     GtkTreeViewColumn *column;
-    gboolean hide_spacer;
     GList *columns, *tmp;
     gchar *name, *pref_name;
     va_list args;
@@ -1423,9 +1421,7 @@ void gnc_tree_view_expand_columns (GncTreeView *view,
     g_return_if_fail (GNC_IS_TREE_VIEW(view));
     ENTER(" ");
     va_start (args, first_column_name);
-    priv = GNC_TREE_VIEW_GET_PRIVATE(view);
     name = first_column_name;
-    hide_spacer = FALSE;
 
     /* First disable the expand property on all (non-infrastructure) columns. */
     columns = gtk_tree_view_get_columns (GTK_TREE_VIEW(view));
@@ -1445,7 +1441,6 @@ void gnc_tree_view_expand_columns (GncTreeView *view,
         if (column != NULL)
         {
             gtk_tree_view_column_set_expand (column, TRUE);
-            hide_spacer = TRUE;
         }
         name = va_arg (args, gchar*);
     }
diff --git a/gnucash/gnome/gnc-budget-view.c b/gnucash/gnome/gnc-budget-view.c
index ccbdd18b3..f0ac0ce6b 100644
--- a/gnucash/gnome/gnc-budget-view.c
+++ b/gnucash/gnome/gnc-budget-view.c
@@ -1439,12 +1439,10 @@ gbv_renderer_add_padding (GtkCellRenderer *renderer)
 static GtkTreeViewColumn*
 gbv_create_totals_column (GncBudgetView *budget_view, gint period_num)
 {
-    GncBudgetViewPrivate *priv;
     GtkTreeViewColumn *col;
     GtkCellRenderer* renderer;
 
     g_return_val_if_fail (budget_view != NULL, NULL);
-    priv = GNC_BUDGET_VIEW_GET_PRIVATE(budget_view);
 
     renderer = gtk_cell_renderer_text_new ();
     col = gtk_tree_view_column_new_with_attributes ("", renderer, NULL);
diff --git a/gnucash/gnome/gnc-plugin-page-budget.c b/gnucash/gnome/gnc-plugin-page-budget.c
index 678cd899f..022093c46 100644
--- a/gnucash/gnome/gnc-plugin-page-budget.c
+++ b/gnucash/gnome/gnc-plugin-page-budget.c
@@ -1243,7 +1243,6 @@ gnc_plugin_page_budget_cmd_budget_note (GSimpleAction *simple,
 {
     GncPluginPageBudget *page = user_data;
     GncPluginPageBudgetPrivate *priv;
-    GtkTreeSelection *sel;
     GtkWidget *dialog, *note;
     gint result;
     GtkBuilder *builder;
@@ -1255,8 +1254,6 @@ gnc_plugin_page_budget_cmd_budget_note (GSimpleAction *simple,
 
     g_return_if_fail(GNC_IS_PLUGIN_PAGE_BUDGET(page));
     priv = GNC_PLUGIN_PAGE_BUDGET_GET_PRIVATE(page);
-    sel  = gnc_budget_view_get_selection(priv->budget_view);
-
     gtk_tree_view_get_cursor(
         GTK_TREE_VIEW(gnc_budget_view_get_account_tree_view(priv->budget_view)),
         &path, &col);
diff --git a/gnucash/gnome/gnc-plugin-page-invoice.c b/gnucash/gnome/gnc-plugin-page-invoice.c
index 97d318cb5..f89569c8e 100644
--- a/gnucash/gnome/gnc-plugin-page-invoice.c
+++ b/gnucash/gnome/gnc-plugin-page-invoice.c
@@ -1318,14 +1318,12 @@ gnc_plugin_page_invoice_cmd_link_remove (GSimpleAction *simple,
 {
     GncPluginPageInvoice *plugin_page = user_data;
     GncPluginPageInvoicePrivate *priv;
-    GtkWindow *parent;
     GncInvoice *invoice;
     GtkWidget *doclink_button;
 
     g_return_if_fail (GNC_IS_PLUGIN_PAGE_INVOICE(plugin_page));
     ENTER("(action %p, plugin_page %p)", simple, plugin_page);
     priv = GNC_PLUGIN_PAGE_INVOICE_GET_PRIVATE(plugin_page);
-    parent = GTK_WINDOW(gnc_plugin_page_get_window (GNC_PLUGIN_PAGE(plugin_page)));
 
     invoice = gnc_invoice_window_get_invoice (priv->iw);
     gncInvoiceSetDocLink (invoice, "");
diff --git a/gnucash/gnome/gnc-plugin-page-register.c b/gnucash/gnome/gnc-plugin-page-register.c
index 3020fcc04..637ee6c7d 100644
--- a/gnucash/gnome/gnc-plugin-page-register.c
+++ b/gnucash/gnome/gnc-plugin-page-register.c
@@ -3695,14 +3695,12 @@ gnc_plugin_page_register_cmd_edit_tax_options (GSimpleAction *simple,
                                                gpointer       user_data)
 {
     GncPluginPageRegister* page = user_data;
-    GncPluginPageRegisterPrivate* priv;
     GtkWidget *window;
     Account* account;
 
     g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER (page));
 
     ENTER ("(action %p, page %p)", simple, page);
-    priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
     window = gnc_plugin_page_get_window (GNC_PLUGIN_PAGE (page));
     account = gnc_plugin_page_register_get_account (page);
     gnc_tax_info_dialog (window, account);
diff --git a/gnucash/gnome/reconcile-view.c b/gnucash/gnome/reconcile-view.c
index be62488c9..cfd66bd33 100644
--- a/gnucash/gnome/reconcile-view.c
+++ b/gnucash/gnome/reconcile-view.c
@@ -361,7 +361,6 @@ gnc_reconcile_view_new (Account *account, GNCReconcileViewType type,
     GNCReconcileView  *view;
     GtkListStore      *liststore;
     GtkTreeSortable   *sortable;
-    GtkTreeViewColumn *col;
     gboolean           include_children, auto_check;
     GList             *accounts = NULL;
     GList             *splits;
@@ -436,7 +435,6 @@ gnc_reconcile_view_new (Account *account, GNCReconcileViewType type,
     /* set up a separate sort function for the recn column as it is
      * derived from a search function */
     sortable = GTK_TREE_SORTABLE(gtk_tree_view_get_model (GTK_TREE_VIEW(view)));
-    col = gtk_tree_view_get_column (GTK_TREE_VIEW(view), REC_RECN -1);
     gtk_tree_sortable_set_sort_func (sortable, REC_RECN, sort_iter_compare_func,
                                      GINT_TO_POINTER (REC_RECN), NULL);
 
diff --git a/gnucash/import-export/bi-import/dialog-bi-import.c b/gnucash/import-export/bi-import/dialog-bi-import.c
index b004064f3..eeaddbf28 100644
--- a/gnucash/import-export/bi-import/dialog-bi-import.c
+++ b/gnucash/import-export/bi-import/dialog-bi-import.c
@@ -621,8 +621,6 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book,
     GtkWidget *dialog;
     time64 today;
     InvoiceWindow *iw;
-    gint64 denom = 0;
-    gnc_commodity *currency;
     GString *running_id;
 
     // these arguments are needed
@@ -771,8 +769,6 @@ gnc_bi_import_create_bis (GtkListStore * store, QofBook * book,
         // Add entry to invoice/bill
         entry = gncEntryCreate (book);
         gncEntryBeginEdit(entry);
-        currency = gncInvoiceGetCurrency(invoice);
-        if (currency) denom = gnc_commodity_get_fraction(currency);
         qof_scan_date (date, &day, &month, &year);
         {
             GDate *date = g_date_new_dmy(day, month, year);
diff --git a/gnucash/import-export/import-backend.cpp b/gnucash/import-export/import-backend.cpp
index 4428597e7..c94f337f6 100644
--- a/gnucash/import-export/import-backend.cpp
+++ b/gnucash/import-export/import-backend.cpp
@@ -884,7 +884,6 @@ gnc_import_process_trans_item (Account *base_acc,
             auto split = xaccMallocSplit (gnc_account_get_book (acct));
             xaccTransAppendSplit (trans, split);
             xaccAccountInsertSplit (acct, split);
-            auto imbalance_value = gnc_numeric_neg (xaccTransGetImbalanceValue (trans));
             xaccSplitSetValue (split, trans_info->lsplit_value);
             if (!gnc_numeric_zero_p (trans_info->lsplit_amount))
                 xaccSplitSetAmount (split, trans_info->lsplit_amount);
diff --git a/gnucash/import-export/import-main-matcher.c b/gnucash/import-export/import-main-matcher.c
index f93bba6ef..f35b775e8 100644
--- a/gnucash/import-export/import-main-matcher.c
+++ b/gnucash/import-export/import-main-matcher.c
@@ -401,7 +401,7 @@ static void
 resolve_conflicts (GNCImportMainMatcher *info)
 {
     GtkTreeModel* model = gtk_tree_view_get_model (info->view);
-    GtkTreeIter import_iter, best_import;
+    GtkTreeIter import_iter;
     gint best_match = 0;
 
     /* A greedy conflict resolution. Find all imported trans that vie for the same
@@ -420,7 +420,6 @@ resolve_conflicts (GNCImportMainMatcher *info)
         // The ID of the best current match for this imported trans
         GncGUID id = *get_top_trans_match_id (match_list);
         best_match = get_top_trans_match_score (match_list);
-        best_import = import_iter;
         /* Get a list of all imported transactions that have a conflict with this one.
          * The returned list excludes the best transaction. */
         GList *conflicts = get_conflict_list (model, import_iter, &id, best_match);
diff --git a/gnucash/register/register-core/quickfillcell.c b/gnucash/register/register-core/quickfillcell.c
index 20c135ffa..e8cdfb470 100644
--- a/gnucash/register/register-core/quickfillcell.c
+++ b/gnucash/register/register-core/quickfillcell.c
@@ -168,10 +168,7 @@ gnc_quickfill_cell_modify_verify (BasicCell *_cell,
     QuickFill *match;
 
     glong newval_chars;
-    glong change_chars;
-
     newval_chars = g_utf8_strlen(newval, newval_len);
-    change_chars = g_utf8_strlen(change, change_len);
 
     /* If deleting, just accept */
     if (change == NULL)
diff --git a/gnucash/register/register-gnome/gnucash-sheet.c b/gnucash/register/register-gnome/gnucash-sheet.c
index d38321903..15d65a7f0 100644
--- a/gnucash/register/register-gnome/gnucash-sheet.c
+++ b/gnucash/register/register-gnome/gnucash-sheet.c
@@ -362,7 +362,6 @@ gnucash_sheet_activate_cursor_cell (GnucashSheet *sheet,
     Table *table = sheet->table;
     VirtualLocation virt_loc;
     SheetBlockStyle *style;
-    GtkEditable *editable;
     int cursor_pos, start_sel, end_sel;
     gboolean allow_edits;
 
@@ -384,8 +383,6 @@ gnucash_sheet_activate_cursor_cell (GnucashSheet *sheet,
     if (strcmp (style->cursor->cursor_name, CURSOR_HEADER) == 0)
         return;
 
-    editable = GTK_EDITABLE(sheet->entry);
-
     cursor_pos = -1;
     start_sel = 0;
     end_sel = 0;
@@ -1887,14 +1884,12 @@ static gint
 gnucash_sheet_key_press_event (GtkWidget *widget, GdkEventKey *event)
 {
     GnucashSheet *sheet;
-    GtkEditable *editable = NULL;
 
     g_return_val_if_fail (widget != NULL, TRUE);
     g_return_val_if_fail (GNUCASH_IS_SHEET(widget), TRUE);
     g_return_val_if_fail (event != NULL, TRUE);
 
     sheet = GNUCASH_SHEET(widget);
-    editable = GTK_EDITABLE(sheet->entry);
     /* bug#60582 comment#27 2
            save shift state to enable <shift minus> and <shift equal>
        bug#618434

commit 0dd406de1030bd5501a6314996b592511aaf2273
Author: Richard Cohen <richard at daijobu.co.uk>
Date:   Thu Jan 26 18:27:39 2023 +0000

    [-Wunused-lambda-capture] (clang) - remove

diff --git a/gnucash/import-export/csv-imp/gnc-import-tx.cpp b/gnucash/import-export/csv-imp/gnc-import-tx.cpp
index 9b5eee8e0..da6dc6162 100644
--- a/gnucash/import-export/csv-imp/gnc-import-tx.cpp
+++ b/gnucash/import-export/csv-imp/gnc-import-tx.cpp
@@ -576,7 +576,7 @@ std::string GncTxImport::verify (bool with_acct_errors)
             have_line_errors = true;
             break;
         }
-        auto non_acct_error = [with_acct_errors](ErrPair curr_err)
+        auto non_acct_error = [](ErrPair curr_err)
         {
             return !((curr_err.first == GncTransPropType::ACCOUNT) ||
                      (curr_err.first == GncTransPropType::TACCOUNT));
diff --git a/libgnucash/app-utils/gnc-quotes.cpp b/libgnucash/app-utils/gnc-quotes.cpp
index e0ade6500..ab46fc05d 100644
--- a/libgnucash/app-utils/gnc-quotes.cpp
+++ b/libgnucash/app-utils/gnc-quotes.cpp
@@ -462,7 +462,7 @@ GncQuotesImpl::query_fq (const char* source, const StrVec& commodities)
 
     std::for_each(is_currency ? ++commodities.cbegin() : commodities.cbegin(),
                   commodities.cend(),
-                  [this, source, &pt](auto sym)
+                  [source, &pt](auto sym)
                       {
                           std::string key{source};
                           key += "." + sym;
diff --git a/libgnucash/engine/kvp-frame.cpp b/libgnucash/engine/kvp-frame.cpp
index b4c5aed50..53d5f2a75 100644
--- a/libgnucash/engine/kvp-frame.cpp
+++ b/libgnucash/engine/kvp-frame.cpp
@@ -166,7 +166,7 @@ KvpFrameImpl::to_string(std::string const & prefix) const noexcept
         return prefix;
     std::ostringstream ret;
     std::for_each(m_valuemap.begin(), m_valuemap.end(),
-        [this,&ret,&prefix](const map_type::value_type &a)
+        [&ret,&prefix](const map_type::value_type &a)
         {
             std::string new_prefix {prefix};
             if (a.first)

commit 0f3813e0fd4b0bf38d673df68590bf8a46a98ffd
Author: Richard Cohen <richard at daijobu.co.uk>
Date:   Mon Feb 13 16:49:25 2023 +0000

    [-Wunused-private-field] (clang) - remove
    
    In file included from gnucash/gnome-utils/dialog-options.cpp:34:
    gnucash/gnome-utils/dialog-options.hpp:55:10: warning: private field 'toplevel' is not used [-Wunused-private-field]
        bool toplevel;
             ^
    
    In file included from gnucash/import-export/csv-imp/gnc-imp-props-price.cpp:42:
    gnucash/import-export/csv-imp/gnc-imp-props-price.hpp:113:10: warning: private field 'created' is not used [-Wunused-private-field]
        bool created = false;
             ^
    
    libgnucash/backend/dbi/gnc-dbisqlconnection.cpp:53:29: warning: private field 'm_conn' is not used [-Wunused-private-field]
        const GncSqlConnection* m_conn = nullptr;
                                ^
    libgnucash/backend/sql/test/utest-gnc-backend-sql.cpp:81:33: warning: private field 'm_conn' is not used [-Wunused-private-field]
        const GncMockSqlConnection* m_conn;
                                    ^

diff --git a/gnucash/gnome-utils/dialog-options.hpp b/gnucash/gnome-utils/dialog-options.hpp
index ae0f45d7f..2856669db 100644
--- a/gnucash/gnome-utils/dialog-options.hpp
+++ b/gnucash/gnome-utils/dialog-options.hpp
@@ -52,8 +52,6 @@ class GncOptionsDialog
     GtkButton  * m_apply_button;
     GtkButton  * m_ok_button;
 
-    bool toplevel;
-
     GncOptionsDialogCallback m_apply_cb;
     gpointer             m_apply_cb_data;
 
diff --git a/gnucash/import-export/csv-imp/gnc-imp-props-price.hpp b/gnucash/import-export/csv-imp/gnc-imp-props-price.hpp
index 8263cef65..fb35cb396 100644
--- a/gnucash/import-export/csv-imp/gnc-imp-props-price.hpp
+++ b/gnucash/import-export/csv-imp/gnc-imp-props-price.hpp
@@ -110,7 +110,6 @@ private:
     std::optional<std::string> m_from_namespace;
     std::optional<std::string> m_from_symbol;
     std::optional<gnc_commodity*> m_to_currency;
-    bool created = false;
 
     std::map<GncPricePropType, std::string> m_errors;
 };
diff --git a/libgnucash/backend/dbi/gnc-dbisqlconnection.cpp b/libgnucash/backend/dbi/gnc-dbisqlconnection.cpp
index 2ec6ed41f..7b4e85fdb 100644
--- a/libgnucash/backend/dbi/gnc-dbisqlconnection.cpp
+++ b/libgnucash/backend/dbi/gnc-dbisqlconnection.cpp
@@ -43,14 +43,13 @@ const std::string lock_table = "gnclock";
 class GncDbiSqlStatement : public GncSqlStatement
 {
 public:
-    GncDbiSqlStatement(const GncSqlConnection* conn, const std::string& sql) :
-        m_conn{conn}, m_sql {sql} {}
+    GncDbiSqlStatement(const std::string& sql) :
+        m_sql {sql} {}
     ~GncDbiSqlStatement() {}
     const char* to_sql() const override;
     void add_where_cond(QofIdTypeConst, const PairVec&) override;
 
 private:
-    const GncSqlConnection* m_conn = nullptr;
     std::string m_sql;
 };
 
@@ -321,7 +320,7 @@ GncSqlStatementPtr
 GncDbiSqlConnection::create_statement_from_sql (const std::string& sql)
     const noexcept
 {
-    return std::unique_ptr<GncSqlStatement>{new GncDbiSqlStatement (this, sql)};
+    return std::unique_ptr<GncSqlStatement>{new GncDbiSqlStatement (sql)};
 }
 
 bool
diff --git a/libgnucash/backend/sql/test/utest-gnc-backend-sql.cpp b/libgnucash/backend/sql/test/utest-gnc-backend-sql.cpp
index 0136d0993..b5f0a256b 100644
--- a/libgnucash/backend/sql/test/utest-gnc-backend-sql.cpp
+++ b/libgnucash/backend/sql/test/utest-gnc-backend-sql.cpp
@@ -48,8 +48,8 @@ class GncMockSqlConnection;
 class GncMockSqlResult : public GncSqlResult
 {
 public:
-    GncMockSqlResult(const GncMockSqlConnection* conn) :
-        m_conn{conn}, m_iter{this}, m_row{&m_iter} {}
+    GncMockSqlResult() :
+        m_iter{this}, m_row{&m_iter} {}
     uint64_t size() const noexcept { return 1; }
     GncSqlRow& begin() { return m_row; }
     GncSqlRow& end() { return m_row; }
@@ -78,7 +78,6 @@ protected:
             GncMockSqlResult* m_inst;
         };
 private:
-    const GncMockSqlConnection* m_conn;
     IteratorImpl m_iter;
     GncSqlRow m_row;
 };
@@ -94,7 +93,6 @@ public:
 class GncMockSqlConnection : public GncSqlConnection
 {
 public:
-    GncMockSqlConnection() : m_result{this} {}
     GncSqlResultPtr execute_select_statement (const GncSqlStatementPtr&)
         noexcept override { return &m_result; }
     int execute_nonselect_statement (const GncSqlStatementPtr&)

commit d4dfe4e279b7a17251cd815091621f80708246d5
Author: Richard Cohen <richard at daijobu.co.uk>
Date:   Thu Jan 26 17:40:52 2023 +0000

    [-Wunused-local-typedef] - remove
    
    libgnucash/engine/test/utest-Account.cpp:2414:11: warning: typedef ‘using AcctTypeType = struct std::underlying_type<GNCAccountType>’ locally defined but not used [-Wunused-local-typedefs]
     2414 |     using AcctTypeType = std::underlying_type<GNCAccountType>;
          |           ^~~~~~~~~~~~

diff --git a/libgnucash/engine/test/utest-Account.cpp b/libgnucash/engine/test/utest-Account.cpp
index b89b33582..6f380ee8b 100644
--- a/libgnucash/engine/test/utest-Account.cpp
+++ b/libgnucash/engine/test/utest-Account.cpp
@@ -2412,7 +2412,6 @@ test_xaccAccountHasAncestor (Fixture *fixture, gconstpointer pData)
 }
 inline GNCAccountType& operator++(GNCAccountType& x)
 {
-    using AcctTypeType = std::underlying_type<GNCAccountType>;
     if (x < ACCT_TYPE_LAST)
         x = static_cast<GNCAccountType>(x + 1);
     return x;

commit 0798bce2a6350d06de40992c0f40e5a039a7ccc5
Author: Richard Cohen <richard at daijobu.co.uk>
Date:   Sat Jan 28 17:33:06 2023 +0000

    [-Wunused-value] - remove
    
    borrowed/jenny/jenny.c: In function ‘next_builder’:
    borrowed/jenny/jenny.c:1164:5: warning: statement with no effect [-Wunused-value]
     1164 |     for (i; i<n-1; ++i) {            /* reset all less significant positions */
          |     ^~~
    borrowed/jenny/jenny.c:1172:5: warning: statement with no effect [-Wunused-value]
     1172 |     for (i; i<n-1; ++i) {            /* reset all less significant positions */
          |     ^~~
    borrowed/jenny/jenny.c: In function ‘confirm’:
    borrowed/jenny/jenny.c:1797:7: warning: statement with no effect [-Wunused-value]
     1797 |       for (i; i<n-1; ++i) {          /* reset all less significant positions */
          |       ^~~
    borrowed/jenny/jenny.c:1805:7: warning: statement with no effect [-Wunused-value]
     1805 |       for (i; i<n-1; ++i) {          /* reset all less significant positions */
          |       ^~~
    
    libgnucash/backend/xml/io-gncxml-v2.cpp: In function ‘gboolean qof_session_load_from_xml_file_v2_full(GncXmlBackend*, QofBook*, sixtp_push_handler, gpointer, QofBookFileType)’:
    libgnucash/backend/xml/io-gncxml-v2.cpp:806:40: warning: value computed is not used [-Wunused-value]
      806 |                 g_thread_join (thread) != nullptr;
          |                 ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
    
    libgnucash/engine/Account.cpp: In function ‘void xaccFreeAccount(Account*)’:
    libgnucash/engine/Account.cpp:1428:17: warning: statement has no effect [-Wunused-value]
     1428 |     priv->color == nullptr;
          |     ~~~~~~~~~~~~^~~~~~~~~~
    libgnucash/engine/Account.cpp:1429:22: warning: statement has no effect [-Wunused-value]
     1429 |     priv->sort_order == nullptr;
          |     ~~~~~~~~~~~~~~~~~^~~~~~~~~~
    libgnucash/engine/Account.cpp:1430:17: warning: statement has no effect [-Wunused-value]
     1430 |     priv->notes == nullptr;
          |     ~~~~~~~~~~~~^~~~~~~~~~
    libgnucash/engine/Account.cpp:1431:18: warning: statement has no effect [-Wunused-value]
     1431 |     priv->filter == nullptr;
          |     ~~~~~~~~~~~~~^~~~~~~~~~
    
    libgnucash/engine/gnc-int128.cpp: In function ‘void decimal_from_binary(uint64_t*, uint64_t, uint64_t)’:
    libgnucash/engine/gnc-int128.cpp:898:36: warning: right operand of comma operator has no effect [-Wunused-value]
      898 |     d[3] = (hi >> 32) & bin_mask, 0;
          |                                    ^

diff --git a/borrowed/jenny/jenny.c b/borrowed/jenny/jenny.c
index 489f99671..2b2d3c63a 100644
--- a/borrowed/jenny/jenny.c
+++ b/borrowed/jenny/jenny.c
@@ -1161,7 +1161,7 @@ next_builder( state *s, feature *tuple, ub1 n)
     return FALSE;
   else if (tuple[i].f < s->dim[tuple[i].d]-1) {
     ++tuple[i].f;                                       /* increment feature */
-    for (i; i<n-1; ++i) {            /* reset all less significant positions */
+    for (; i<n-1; ++i) {            /* reset all less significant positions */
       tuple[i+1].d = tuple[i].d+1;
       tuple[i+1].f = 0;
     }
@@ -1169,7 +1169,7 @@ next_builder( state *s, feature *tuple, ub1 n)
   else {
     ++tuple[i].d;      /* increment least significant non-maxed-out position */
     tuple[i].f = (ub2)0;                                /* reset its feature */
-    for (i; i<n-1; ++i) {            /* reset all less significant positions */
+    for (; i<n-1; ++i) {            /* reset all less significant positions */
       tuple[i+1].d = tuple[i].d+1;
       tuple[i+1].f = 0;
     }
@@ -1792,7 +1792,7 @@ confirm( state *s)
       break;                                                         /* done */
     else if (offset[i].f < s->dim[offset[i].d]-1) {
       ++offset[i].f;                                    /* increment feature */
-      for (i; i<n-1; ++i) {          /* reset all less significant positions */
+      for (; i<n-1; ++i) {          /* reset all less significant positions */
         offset[i+1].d = offset[i].d+1;
         offset[i+1].f = 0;
       }
@@ -1800,7 +1800,7 @@ confirm( state *s)
     else {
       ++offset[i].d;   /* increment least significant non-maxed-out position */
       offset[i].f = (ub2)0;                             /* reset its feature */
-      for (i; i<n-1; ++i) {          /* reset all less significant positions */
+      for (; i<n-1; ++i) {          /* reset all less significant positions */
         offset[i+1].d = offset[i].d+1;
         offset[i+1].f = 0;
       }
diff --git a/libgnucash/backend/xml/io-gncxml-v2.cpp b/libgnucash/backend/xml/io-gncxml-v2.cpp
index 5f27b90e9..2b37b4b1a 100644
--- a/libgnucash/backend/xml/io-gncxml-v2.cpp
+++ b/libgnucash/backend/xml/io-gncxml-v2.cpp
@@ -803,7 +803,7 @@ qof_session_load_from_xml_file_v2_full (
                                        generic_callback, gd, book);
             fclose (file);
             if (thread)
-                g_thread_join (thread) != nullptr;
+                g_thread_join (thread);
         }
     }
 
diff --git a/libgnucash/engine/Account.cpp b/libgnucash/engine/Account.cpp
index 407e1cc8f..50333b232 100644
--- a/libgnucash/engine/Account.cpp
+++ b/libgnucash/engine/Account.cpp
@@ -1425,10 +1425,10 @@ xaccFreeAccount (Account *acc)
     priv->last_num = nullptr;
     priv->tax_us_code = nullptr;
     priv->tax_us_pns = nullptr;
-    priv->color == nullptr;
-    priv->sort_order == nullptr;
-    priv->notes == nullptr;
-    priv->filter == nullptr;
+    priv->color = nullptr;
+    priv->sort_order = nullptr;
+    priv->notes = nullptr;
+    priv->filter = nullptr;
 
     priv->parent = nullptr;
     priv->children = nullptr;
diff --git a/libgnucash/engine/gnc-int128.cpp b/libgnucash/engine/gnc-int128.cpp
index 340dbe1f3..a4242e6ab 100644
--- a/libgnucash/engine/gnc-int128.cpp
+++ b/libgnucash/engine/gnc-int128.cpp
@@ -895,7 +895,7 @@ decimal_from_binary (uint64_t d[dec_array_size], uint64_t hi, uint64_t lo)
     d[0] = lo & bin_mask;
     d[1] = (lo >> 32) & bin_mask;
     d[2] = hi & bin_mask;
-    d[3] = (hi >> 32) & bin_mask, 0;
+    d[3] = (hi >> 32) & bin_mask;
 
     d[0] += coeff_3[3] * d[3] + coeff_2[3] * d[2] + coeff_1[3] * d[1];
     uint64_t q {d[0] / dec_div};



Summary of changes:
 CMakeLists.txt                                     |   6 +-
 bindings/python/time64.i                           |   4 +
 borrowed/jenny/jenny.c                             | 106 +-------------
 gnucash/gnome-utils/dialog-account.c               |  10 --
 gnucash/gnome-utils/dialog-options.cpp             |  11 --
 gnucash/gnome-utils/dialog-options.hpp             |   2 -
 gnucash/gnome-utils/gnc-cell-view.c                |   2 -
 gnucash/gnome-utils/gnc-gtk-utils.c                |   4 -
 gnucash/gnome-utils/gnc-main-window.cpp            |  13 +-
 gnucash/gnome-utils/gnc-option-gtk-ui.cpp          |  30 ----
 gnucash/gnome-utils/gnc-plugin-page.c              |   3 -
 gnucash/gnome-utils/gnc-query-view.c               |   2 -
 gnucash/gnome-utils/gnc-report-combo.c             |   9 +-
 gnucash/gnome-utils/gnc-tree-view-account.c        |  17 ---
 gnucash/gnome-utils/gnc-tree-view.c                |   5 -
 gnucash/gnome/business-gnome-utils.c               |   2 +-
 gnucash/gnome/dialog-custom-report.c               |   3 +-
 gnucash/gnome/dialog-imap-editor.c                 |  18 ---
 gnucash/gnome/dialog-payment.c                     |   7 -
 gnucash/gnome/gnc-budget-view.c                    |   2 -
 gnucash/gnome/gnc-plugin-budget.c                  |   2 -
 gnucash/gnome/gnc-plugin-page-budget.c             |   3 -
 gnucash/gnome/gnc-plugin-page-invoice.c            |  31 ----
 gnucash/gnome/gnc-plugin-page-register.c           |  22 ---
 gnucash/gnome/reconcile-view.c                     |   2 -
 gnucash/import-export/aqb/dialog-ab-trans.c        |  19 +--
 gnucash/import-export/bi-import/dialog-bi-import.c |   4 -
 .../import-export/csv-imp/gnc-imp-props-price.hpp  |   1 -
 gnucash/import-export/csv-imp/gnc-imp-props-tx.cpp |   2 -
 .../csv-imp/gnc-imp-settings-csv-price.cpp         |  22 ---
 gnucash/import-export/csv-imp/gnc-import-tx.cpp    |   2 +-
 gnucash/import-export/import-account-matcher.c     |  11 --
 gnucash/import-export/import-backend.cpp           |  59 --------
 gnucash/import-export/import-main-matcher.c        |  33 +----
 gnucash/import-export/log-replay/gnc-log-replay.c  |   2 -
 .../test/test-import-pending-matches.cpp           |   2 +
 .../register/ledger-core/split-register-model.c    |  11 --
 gnucash/register/register-core/quickfillcell.c     |   3 -
 .../register-gnome/gnucash-sheet-private.c         |  24 ---
 gnucash/register/register-gnome/gnucash-sheet.c    |  21 +--
 libgnucash/app-utils/gfec.c                        |   6 -
 libgnucash/app-utils/gnc-quotes.cpp                |   4 +-
 libgnucash/backend/dbi/gnc-dbisqlconnection.cpp    |   7 +-
 libgnucash/backend/dbi/test/test-dbi-stuff.cpp     |   5 -
 libgnucash/backend/sql/gnc-slots-sql.cpp           |  37 -----
 libgnucash/backend/sql/gnc-transaction-sql.cpp     | 162 ---------------------
 .../backend/sql/test/utest-gnc-backend-sql.cpp     |   6 +-
 libgnucash/backend/xml/gnc-transaction-xml-v2.cpp  |  10 --
 libgnucash/backend/xml/io-gncxml-v2.cpp            |   2 +-
 libgnucash/core-utils/gnc-filepath-utils.cpp       |   1 -
 libgnucash/engine/Account.cpp                      |   8 +-
 libgnucash/engine/Transaction.c                    |  19 ---
 libgnucash/engine/gnc-int128.cpp                   |   2 +-
 libgnucash/engine/gnc-optiondb.cpp                 |  49 -------
 libgnucash/engine/kvp-frame.cpp                    |   2 +-
 libgnucash/engine/policy.c                         |  37 -----
 libgnucash/engine/qofobject.cpp                    |   6 -
 libgnucash/engine/test-core/test-engine-stuff.cpp  |  40 -----
 libgnucash/engine/test-core/test-engine-stuff.h    |   1 -
 libgnucash/engine/test/test-gnc-date.c             |  49 -------
 libgnucash/engine/test/test-qofinstance.cpp        |   9 --
 libgnucash/engine/test/test-qofsession.cpp         |   7 -
 libgnucash/engine/test/utest-Account.cpp           |   1 -
 63 files changed, 43 insertions(+), 959 deletions(-)



More information about the gnucash-changes mailing list