| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3469,7 +3469,8 @@ PyUnicode_DecodeLocaleAndSize(const char *str, Py_ssize_t len, | |||
| 3469 | 3469 | int surrogateescape; | |
| 3470 | 3470 | size_t error_pos; | |
| 3471 | 3471 | char *errmsg; | |
| 3472 | - PyObject *reason, *exc; | ||
| 3472 | + PyObject *reason = NULL; /* initialize to prevent gcc warning */ | ||
| 3473 | + PyObject *exc; | ||
| 3473 | 3474 | ||
| 3474 | 3475 | if (locale_error_handler(errors, &surrogateescape) < 0) | |
| 3475 | 3476 | return NULL; | |
@@ -9454,7 +9455,7 @@ handle_capital_sigma(int kind, void *data, Py_ssize_t length, Py_ssize_t i) | |||
| 9454 | 9455 | { | |
| 9455 | 9456 | Py_ssize_t j; | |
| 9456 | 9457 | int final_sigma; | |
| 9457 | - Py_UCS4 c; | ||
| 9458 | + Py_UCS4 c = 0; /* initialize to prevent gcc warning */ | ||
| 9458 | 9459 | /* U+03A3 is in the Final_Sigma context when, it is found like this: | |
| 9459 | 9460 | ||
| 9460 | 9461 | \p{cased}\p{case-ignorable}*U+03A3!(\p{case-ignorable}*\p{cased}) | |
@@ -11124,7 +11125,7 @@ interpreted as in slice notation."); | |||
| 11124 | 11125 | static PyObject * | |
| 11125 | 11126 | unicode_count(PyObject *self, PyObject *args) | |
| 11126 | 11127 | { | |
| 11127 | - PyObject *substring; | ||
| 11128 | + PyObject *substring = NULL; /* initialize to fix a compiler warning */ | ||
| 11128 | 11129 | Py_ssize_t start = 0; | |
| 11129 | 11130 | Py_ssize_t end = PY_SSIZE_T_MAX; | |
| 11130 | 11131 | PyObject *result; | |
@@ -11312,9 +11313,10 @@ Return -1 on failure."); | |||
| 11312 | 11313 | static PyObject * | |
| 11313 | 11314 | unicode_find(PyObject *self, PyObject *args) | |
| 11314 | 11315 | { | |
| 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; | ||
| 11318 | 11320 | Py_ssize_t result; | |
| 11319 | 11321 | ||
| 11320 | 11322 | 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."); | |||
| 11399 | 11401 | static PyObject * | |
| 11400 | 11402 | unicode_index(PyObject *self, PyObject *args) | |
| 11401 | 11403 | { | |
| 11404 | + /* initialize variables to prevent gcc warning */ | ||
| 11402 | 11405 | 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; | ||
| 11406 | 11409 | ||
| 11407 | 11410 | if (!stringlib_parse_args_finds_unicode("index", args, &substring, | |
| 11408 | 11411 | &start, &end)) | |
@@ -12477,9 +12480,10 @@ Return -1 on failure."); | |||
| 12477 | 12480 | static PyObject * | |
| 12478 | 12481 | unicode_rfind(PyObject *self, PyObject *args) | |
| 12479 | 12482 | { | |
| 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; | ||
| 12483 | 12487 | Py_ssize_t result; | |
| 12484 | 12488 | ||
| 12485 | 12489 | 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."); | |||
| 12513 | 12517 | static PyObject * | |
| 12514 | 12518 | unicode_rindex(PyObject *self, PyObject *args) | |
| 12515 | 12519 | { | |
| 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; | ||
| 12519 | 12524 | Py_ssize_t result; | |
| 12520 | 12525 | ||
| 12521 | 12526 | if (!stringlib_parse_args_finds_unicode("rindex", args, &substring, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -115,7 +115,7 @@ validate_arguments(arguments_ty args) | |||
| 115 | 115 | } | |
| 116 | 116 | if (!validate_args(args->kwonlyargs)) | |
| 117 | 117 | return 0; | |
| 118 | - if (args->kwarg && args->kwarg->annotation | ||
| 118 | + if (args->kwarg && args->kwarg->annotation | ||
| 119 | 119 | && !validate_expr(args->kwarg->annotation, Load)) { | |
| 120 | 120 | return 0; | |
| 121 | 121 | } | |
@@ -164,6 +164,8 @@ validate_expr(expr_ty exp, expr_context_ty ctx) | |||
| 164 | 164 | return 0; | |
| 165 | 165 | } | |
| 166 | 166 | check_ctx = 0; | |
| 167 | + /* set actual_ctx to prevent gcc warning */ | ||
| 168 | + actual_ctx = 0; | ||
| 167 | 169 | } | |
| 168 | 170 | if (check_ctx && actual_ctx != ctx) { | |
| 169 | 171 | PyErr_Format(PyExc_ValueError, "expression must have %s context but has %s instead", | |
@@ -451,7 +453,7 @@ validate_exprs(asdl_seq *exprs, expr_context_ty ctx, int null_ok) | |||
| 451 | 453 | "None disallowed in expression list"); | |
| 452 | 454 | return 0; | |
| 453 | 455 | } | |
| 454 | - | ||
| 456 | + | ||
| 455 | 457 | } | |
| 456 | 458 | return 1; | |
| 457 | 459 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,7 +53,7 @@ builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds) | |||
| 53 | 53 | PyObject *func, *name, *bases, *mkw, *meta, *winner, *prep, *ns, *cell; | |
| 54 | 54 | PyObject *cls = NULL; | |
| 55 | 55 | Py_ssize_t nargs; | |
| 56 | - int isclass; | ||
| 56 | + int isclass = 0; /* initialize to prevent gcc warning */ | ||
| 57 | 57 | ||
| 58 | 58 | assert(args != NULL); | |
| 59 | 59 | if (!PyTuple_Check(args)) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments