Skip to content

Commit

Permalink
[-Wunused-variable] - pretend to use
Browse files Browse the repository at this point in the history
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 ;
      |          ^~~~~~
  • Loading branch information
richardcohen committed Feb 16, 2023
1 parent f63dddc commit 56d9505
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bindings/python/time64.i
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 56d9505

Please sign in to comment.