summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2022-01-27 18:26:47 +1300
committerOlly Betts <ojwbetts@gmail.com>2022-01-27 22:34:30 +1300
commitcb1c60e3d89afeb976b0e03c0c5c8d2d78d1dd5c (patch)
tree39703a9c8d297cbcd744eb551b2ef313c43565fa
parentbb011e28a98610727f73bb8d0e4aafa8d5ba8fbc (diff)
downloadswig-cb1c60e3d89afeb976b0e03c0c5c8d2d78d1dd5c.tar.gz
[python] Fix GCC -Wunused-variable with -builtin
Fixes #1697
-rw-r--r--Source/Modules/python.cxx2
1 files changed, 1 insertions, 1 deletions
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);
}