Initialise _v to 0 in typecheck case

This avoids using _v uninitialised if there's an empty typecheck
typemap, such as the dummy one we have for std::initializer_list.

Fixes GCC warning on cpp11_initializer_list testcase when compiled
with -O2.
This commit is contained in:
Olly Betts 2021-04-19 17:39:03 +12:00
commit 5ec65fde0a
2 changed files with 6 additions and 1 deletions

View file

@ -809,7 +809,7 @@ String *Swig_overload_dispatch(Node *n, const_String_or_char_ptr fmt, int *maxar
}
if (num_arguments) {
Printf(f, "int _v;\n");
Printf(f, "int _v = 0;\n");
}
int num_braces = 0;