@@ -3469,7 +3469,8 @@ PyUnicode_DecodeLocaleAndSize(const char *str, Py_ssize_t len,
34693469 int surrogateescape ;
34703470 size_t error_pos ;
34713471 char * errmsg ;
3472- PyObject * reason , * exc ;
3472+ PyObject * reason = NULL ; /* initialize to prevent gcc warning */
3473+ PyObject * exc ;
34733474
34743475 if (locale_error_handler (errors , & surrogateescape ) < 0 )
34753476 return NULL ;
@@ -9454,7 +9455,7 @@ handle_capital_sigma(int kind, void *data, Py_ssize_t length, Py_ssize_t i)
94549455{
94559456 Py_ssize_t j ;
94569457 int final_sigma ;
9457- Py_UCS4 c ;
9458+ Py_UCS4 c = 0 ; /* initialize to prevent gcc warning */
94589459 /* U+03A3 is in the Final_Sigma context when, it is found like this:
94599460
94609461 \p{cased}\p{case-ignorable}*U+03A3!(\p{case-ignorable}*\p{cased})
@@ -11124,7 +11125,7 @@ interpreted as in slice notation.");
1112411125static PyObject *
1112511126unicode_count (PyObject * self , PyObject * args )
1112611127{
11127- PyObject * substring ;
11128+ PyObject * substring = NULL ; /* initialize to fix a compiler warning */
1112811129 Py_ssize_t start = 0 ;
1112911130 Py_ssize_t end = PY_SSIZE_T_MAX ;
1113011131 PyObject * result ;
@@ -11312,9 +11313,10 @@ Return -1 on failure.");
1131211313static PyObject *
1131311314unicode_find (PyObject * self , PyObject * args )
1131411315{
11315- PyObject * substring ;
11316- Py_ssize_t start ;
11317- Py_ssize_t end ;
11316+ /* initialize variables to prevent gcc warning */
11317+ PyObject * substring = NULL ;
11318+ Py_ssize_t start = 0 ;
11319+ Py_ssize_t end = 0 ;
1131811320 Py_ssize_t result ;
1131911321
1132011322 if (!stringlib_parse_args_finds_unicode ("find" , args , & substring ,
@@ -11399,10 +11401,11 @@ Like S.find() but raise ValueError when the substring is not found.");
1139911401static PyObject *
1140011402unicode_index (PyObject * self , PyObject * args )
1140111403{
11404+ /* initialize variables to prevent gcc warning */
1140211405 Py_ssize_t result ;
11403- PyObject * substring ;
11404- Py_ssize_t start ;
11405- Py_ssize_t end ;
11406+ PyObject * substring = NULL ;
11407+ Py_ssize_t start = 0 ;
11408+ Py_ssize_t end = 0 ;
1140611409
1140711410 if (!stringlib_parse_args_finds_unicode ("index" , args , & substring ,
1140811411 & start , & end ))
@@ -12477,9 +12480,10 @@ Return -1 on failure.");
1247712480static PyObject *
1247812481unicode_rfind (PyObject * self , PyObject * args )
1247912482{
12480- PyObject * substring ;
12481- Py_ssize_t start ;
12482- Py_ssize_t end ;
12483+ /* initialize variables to prevent gcc warning */
12484+ PyObject * substring = NULL ;
12485+ Py_ssize_t start = 0 ;
12486+ Py_ssize_t end = 0 ;
1248312487 Py_ssize_t result ;
1248412488
1248512489 if (!stringlib_parse_args_finds_unicode ("rfind" , args , & substring ,
@@ -12513,9 +12517,10 @@ Like S.rfind() but raise ValueError when the substring is not found.");
1251312517static PyObject *
1251412518unicode_rindex (PyObject * self , PyObject * args )
1251512519{
12516- PyObject * substring ;
12517- Py_ssize_t start ;
12518- Py_ssize_t end ;
12520+ /* initialize variables to prevent gcc warning */
12521+ PyObject * substring = NULL ;
12522+ Py_ssize_t start = 0 ;
12523+ Py_ssize_t end = 0 ;
1251912524 Py_ssize_t result ;
1252012525
1252112526 if (!stringlib_parse_args_finds_unicode ("rindex" , args , & substring ,
0 commit comments