Suppress compiler warning in libpq_pipeline.c.
authorTom Lane <[email protected]>
Wed, 31 Mar 2021 19:30:04 +0000 (15:30 -0400)
committerTom Lane <[email protected]>
Wed, 31 Mar 2021 19:30:04 +0000 (15:30 -0400)
Some compilers seem to be concerned about the possibility that
recv_step is not any of the defined enum values.  Silence
warnings about uninitialized cmdtag in a different way than
I did in 9fb9691a8.

src/test/modules/libpq_pipeline/libpq_pipeline.c

index 92af8698d69b9a077f2f1f00ad99fdce87a11769..6e136877047b9a46381cb236a73fc15b53626802 100644 (file)
@@ -646,7 +646,7 @@ test_pipelined_insert(PGconn *conn, int n_rows)
            while (!PQisBusy(conn) && recv_step < BI_DONE)
            {
                PGresult   *res;
-               const char *cmdtag;
+               const char *cmdtag = "";
                const char *description = "";
                int         status;
 
@@ -697,7 +697,6 @@ test_pipelined_insert(PGconn *conn, int n_rows)
                    case BI_DONE:
                        /* unreachable */
                        pg_fatal("unreachable state");
-                       cmdtag = NULL;  /* keep compiler quiet */
                }
 
                if (PQresultStatus(res) != status)