Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 493490c

Browse files
committed
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
1 parent e11e24b commit 493490c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/interfaces/libpq/fe-connect.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1668,6 +1668,7 @@ connectDBStart(PGconn *conn)
16681668
snprintf(portstr, sizeof(portstr), "%d", thisport);
16691669

16701670
/* Use pg_getaddrinfo_all() to resolve the address */
1671+
ret = 1;
16711672
switch (ch->type)
16721673
{
16731674
case CHT_HOST_NAME:

0 commit comments

Comments
 (0)