Issue #8914: fix various warnings from the Clang static analyzer v254.
diff --git a/Python/ast.c b/Python/ast.c
index 4edf335..e62a215 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -3231,7 +3231,6 @@
     const char *end;
 
     if (encoding == NULL) {
-        buf = (char *)s;
         u = NULL;
     } else {
         /* check for integer overflow */
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index f9b3202..42bc809 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -37,7 +37,7 @@
 {
     PyObject *func, *name, *bases, *mkw, *meta, *prep, *ns, *cell;
     PyObject *cls = NULL;
-    Py_ssize_t nargs, nbases;
+    Py_ssize_t nargs;
 
     assert(args != NULL);
     if (!PyTuple_Check(args)) {
@@ -61,7 +61,6 @@
     bases = PyTuple_GetSlice(args, 2, nargs);
     if (bases == NULL)
         return NULL;
-    nbases = nargs - 2;
 
     if (kwds == NULL) {
         meta = NULL;
@@ -766,7 +765,6 @@
 {
     PyObject *v;
     PyObject *prog, *globals = Py_None, *locals = Py_None;
-    int plain = 0;
 
     if (!PyArg_UnpackTuple(args, "exec", 1, 3, &prog, &globals, &locals))
         return NULL;
@@ -775,7 +773,6 @@
         globals = PyEval_GetGlobals();
         if (locals == Py_None) {
             locals = PyEval_GetLocals();
-            plain = 1;
         }
         if (!globals || !locals) {
             PyErr_SetString(PyExc_SystemError,
diff --git a/Python/ceval.c b/Python/ceval.c
index c10a2ff..9572918 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2690,7 +2690,7 @@
                 Py_DECREF(*pfunc);
                 *pfunc = self;
                 na++;
-                n++;
+                /* n++; */
             } else
                 Py_INCREF(func);
             sp = stack_pointer;
@@ -3026,7 +3026,7 @@
                                 PyTrace_RETURN, retval)) {
                 Py_XDECREF(retval);
                 retval = NULL;
-                why = WHY_EXCEPTION;
+                /* why = WHY_EXCEPTION; */
             }
         }
     }
diff --git a/Python/dtoa.c b/Python/dtoa.c
index 44dc01f..82b6faa 100644
--- a/Python/dtoa.c
+++ b/Python/dtoa.c
@@ -2055,7 +2055,7 @@
                         + Exp_msk1
                         ;
                     word1(&rv) = 0;
-                    dsign = 0;
+                    /* dsign = 0; */
                     break;
                 }
             }
@@ -2092,7 +2092,7 @@
                     goto undfl;
                 }
             }
-            dsign = 1 - dsign;
+            /* dsign = 1 - dsign; */
             break;
         }
         if ((aadj = ratio(delta, bs)) <= 2.) {
diff --git a/Python/getargs.c b/Python/getargs.c
index 600941d..17d5993 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -966,9 +966,10 @@
     case 'u': /* raw unicode buffer (Py_UNICODE *) */
     case 'Z': /* raw unicode buffer or None */
     {
+        Py_UNICODE **p = va_arg(*p_va, Py_UNICODE **);
+
         if (*format == '#') { /* any buffer-like object */
             /* "s#" or "Z#" */
-            Py_UNICODE **p = va_arg(*p_va, Py_UNICODE **);
             FETCH_SIZE;
 
             if (c == 'Z' && arg == Py_None) {
@@ -984,8 +985,6 @@
             format++;
         } else {
             /* "s" or "Z" */
-            Py_UNICODE **p = va_arg(*p_va, Py_UNICODE **);
-
             if (c == 'Z' && arg == Py_None)
                 *p = NULL;
             else if (PyUnicode_Check(arg)) {
diff --git a/Python/pystrtod.c b/Python/pystrtod.c
index 75e3032..7bf21c0 100644
--- a/Python/pystrtod.c
+++ b/Python/pystrtod.c
@@ -954,7 +954,7 @@
             /* shouldn't get here: Gay's code should always return
                something starting with a digit, an 'I',  or 'N' */
             strncpy(p, "ERR", 3);
-            p += 3;
+            /* p += 3; */
             assert(0);
         }
         goto exit;
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index de51155..89fe4f1 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1176,7 +1176,6 @@
     PyObject *opts;
     PyObject *name = NULL, *value = NULL;
     const wchar_t *name_end;
-    int r;
 
     opts = get_xoptions();
     if (opts == NULL)
@@ -1194,7 +1193,7 @@
     }
     if (name == NULL || value == NULL)
         goto error;
-    r = PyDict_SetItem(opts, name, value);
+    PyDict_SetItem(opts, name, value);
     Py_DECREF(name);
     Py_DECREF(value);
     return;