Fix potential for compiler warning in GlobalVisTestFor().
authorAndres Freund
Mon, 13 Sep 2021 23:50:10 +0000 (16:50 -0700)
committerAndres Freund
Mon, 13 Sep 2021 23:50:10 +0000 (16:50 -0700)
In d9d8aa9bb9a I added a defensive NULL assignment to protect against a
not-too-smart compiler warning about unitialized variable use after the
switch. Unfortunately I only did so on master and forgot to adjust that for
14.

Stephen noticed that there actually is a compiler warning :(.

Reported-By: Stephen Frost
Discussion: https://postgr.es/m/20210827224639[email protected]

src/backend/storage/ipc/procarray.c

index aa3e1419a9e4a35bd50463efec6ffdfa4e300060..739b4cd51d063b61d7e5a8d110698e605d0c6c0c 100644 (file)
@@ -4027,7 +4027,7 @@ DisplayXidCache(void)
 GlobalVisState *
 GlobalVisTestFor(Relation rel)
 {
-   GlobalVisState *state;
+   GlobalVisState *state = NULL;
 
    /* XXX: we should assert that a snapshot is pushed or registered */
    Assert(RecentXmin);