From cb1c60e3d89afeb976b0e03c0c5c8d2d78d1dd5c Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Thu, 27 Jan 2022 18:26:47 +1300 Subject: [PATCH] [python] Fix GCC -Wunused-variable with -builtin Fixes #1697 --- Source/Modules/python.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx index 6ca64e10f..56c568efa 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -2810,7 +2810,7 @@ public: /* Generate code for argument marshalling */ if (funpack) { - if (num_arguments > 0 && !overname) { + if (num_arguments > (builtin_self && !constructor ? 1 : 0) && !overname) { sprintf(source, "PyObject *swig_obj[%d]", num_arguments); Wrapper_add_localv(f, "swig_obj", source, NIL); }