int surrogateescape;
size_t error_pos;
char *errmsg;
- PyObject *reason, *exc;
+ PyObject *reason = NULL; /* initialize to prevent gcc warning */
+ PyObject *exc;
if (locale_error_handler(errors, &surrogateescape) < 0)
return NULL;
{
Py_ssize_t j;
int final_sigma;
- Py_UCS4 c;
+ Py_UCS4 c = 0; /* initialize to prevent gcc warning */
/* U+03A3 is in the Final_Sigma context when, it is found like this:
\p{cased}\p{case-ignorable}*U+03A3!(\p{case-ignorable}*\p{cased})
static PyObject *
unicode_count(PyObject *self, PyObject *args)
{
- PyObject *substring;
+ PyObject *substring = NULL; /* initialize to fix a compiler warning */
Py_ssize_t start = 0;
Py_ssize_t end = PY_SSIZE_T_MAX;
PyObject *result;
static PyObject *
unicode_find(PyObject *self, PyObject *args)
{
- PyObject *substring;
- Py_ssize_t start;
- Py_ssize_t end;
+ /* initialize variables to prevent gcc warning */
+ PyObject *substring = NULL;
+ Py_ssize_t start = 0;
+ Py_ssize_t end = 0;
Py_ssize_t result;
if (!stringlib_parse_args_finds_unicode("find", args, &substring,
static PyObject *
unicode_index(PyObject *self, PyObject *args)
{
+ /* initialize variables to prevent gcc warning */
Py_ssize_t result;
- PyObject *substring;
- Py_ssize_t start;
- Py_ssize_t end;
+ PyObject *substring = NULL;
+ Py_ssize_t start = 0;
+ Py_ssize_t end = 0;
if (!stringlib_parse_args_finds_unicode("index", args, &substring,
&start, &end))
static PyObject *
unicode_rfind(PyObject *self, PyObject *args)
{
- PyObject *substring;
- Py_ssize_t start;
- Py_ssize_t end;
+ /* initialize variables to prevent gcc warning */
+ PyObject *substring = NULL;
+ Py_ssize_t start = 0;
+ Py_ssize_t end = 0;
Py_ssize_t result;
if (!stringlib_parse_args_finds_unicode("rfind", args, &substring,
static PyObject *
unicode_rindex(PyObject *self, PyObject *args)
{
- PyObject *substring;
- Py_ssize_t start;
- Py_ssize_t end;
+ /* initialize variables to prevent gcc warning */
+ PyObject *substring = NULL;
+ Py_ssize_t start = 0;
+ Py_ssize_t end = 0;
Py_ssize_t result;
if (!stringlib_parse_args_finds_unicode("rindex", args, &substring,
}
if (!validate_args(args->kwonlyargs))
return 0;
- if (args->kwarg && args->kwarg->annotation
+ if (args->kwarg && args->kwarg->annotation
&& !validate_expr(args->kwarg->annotation, Load)) {
return 0;
}
return 0;
}
check_ctx = 0;
+ /* set actual_ctx to prevent gcc warning */
+ actual_ctx = 0;
}
if (check_ctx && actual_ctx != ctx) {
PyErr_Format(PyExc_ValueError, "expression must have %s context but has %s instead",
"None disallowed in expression list");
return 0;
}
-
+
}
return 1;
}
PyObject *func, *name, *bases, *mkw, *meta, *winner, *prep, *ns, *cell;
PyObject *cls = NULL;
Py_ssize_t nargs;
- int isclass;
+ int isclass = 0; /* initialize to prevent gcc warning */
assert(args != NULL);
if (!PyTuple_Check(args)) {