summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas2017-06-09 18:50:35 +0000
committerHeikki Linnakangas2017-06-09 18:50:35 +0000
commit493490cbcb19c5232038827b114a4ec72aa3e731 (patch)
treeb23ec7fb6a1392d9f927ab1f0eb6b71c293fa8bd
parente11e24b1ed619ca329a532e5e5ae8b4e5e728f71 (diff)
Silence warning about uninitialized 'ret' variable on some compilers.
If the compiler doesn't notice that the switch-statement handles all possible values of the enum, it might complain that 'ret' is being used without initialization. Jeff Janes reported that on gcc 4.4.7. Discussion: https://www.postgresql.org/message-id/CAMkU=1x31RvP+cpooFbmc8K8nt-gNO8woGFhXcgQYYZ5ozYpFA@mail.gmail.com
-rw-r--r--src/interfaces/libpq/fe-connect.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index c1dfa5eb97..7a339d67ef 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -1668,6 +1668,7 @@ connectDBStart(PGconn *conn)
snprintf(portstr, sizeof(portstr), "%d", thisport);
/* Use pg_getaddrinfo_all() to resolve the address */
+ ret = 1;
switch (ch->type)
{
case CHT_HOST_NAME: