From 56d950598d65e56f1462038967886b0ec7a50c07 Mon Sep 17 00:00:00 2001 From: Richard Cohen Date: Sat, 28 Jan 2023 17:31:50 +0000 Subject: [PATCH] [-Wunused-variable] - pretend to use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 ; | ^~~~~~ --- bindings/python/time64.i | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bindings/python/time64.i b/bindings/python/time64.i index cf3408a98b..93d9f261f8 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) {