From 139ccc434edcc6c85a9492cd34477e0a86792c51 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Mon, 11 Apr 2011 18:45:07 +0000 Subject: [PATCH] Workaround incorrect gcc 4.4 and 4.5 warning with -O2 -Wextra in generated code git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12631 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- 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 159773ce0..b0a58422b 100644 --- a/Source/Modules/python.cxx +++ b/Source/Modules/python.cxx @@ -1889,7 +1889,7 @@ public: Append(f->code, "argc = args ? (int)PyObject_Length(args) : 0;\n"); if (add_self) Append(f->code, "argv[0] = self;\n"); - Printf(f->code, "for (ii = 0; (ii < argc) && (ii < %d); ii++) {\n", add_self ? maxargs - 1 : maxargs); + Printf(f->code, "for (ii = 0; (ii < %d) && (ii < argc); ii++) {\n", add_self ? maxargs - 1 : maxargs); Printf(f->code, "argv[ii%s] = PyTuple_GET_ITEM(args,ii);\n", add_self ? " + 1" : ""); Append(f->code, "}\n"); if (add_self)