Skip to content

Commit 3f6b3be

Browse files
committed
Silence -Wmaybe-uninitialized compiler warnings in dbcommands.c.
When compiling postgres using gcc -O3, there are false-positive warnings about the now initialized variables. Silence them. Author: Peter Eisentraut, Andres Freund Discussion: https://postgr.es/m/15fb2350-b8b8-e188-278f-0b34fdee5210@2ndquadrant.com
1 parent 5adafaf commit 3f6b3be

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/backend/commands/dbcommands.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "access/genam.h"
2727
#include "access/heapam.h"
2828
#include "access/htup_details.h"
29+
#include "access/multixact.h"
2930
#include "access/tableam.h"
3031
#include "access/xact.h"
3132
#include "access/xloginsert.h"
@@ -103,14 +104,14 @@ createdb(ParseState *pstate, const CreatedbStmt *stmt)
103104
Relation rel;
104105
Oid src_dboid;
105106
Oid src_owner;
106-
int src_encoding;
107-
char *src_collate;
108-
char *src_ctype;
107+
int src_encoding = -1;
108+
char *src_collate = NULL;
109+
char *src_ctype = NULL;
109110
bool src_istemplate;
110111
bool src_allowconn;
111-
Oid src_lastsysoid;
112-
TransactionId src_frozenxid;
113-
MultiXactId src_minmxid;
112+
Oid src_lastsysoid = InvalidOid;
113+
TransactionId src_frozenxid = InvalidTransactionId;
114+
MultiXactId src_minmxid = InvalidMultiXactId;
114115
Oid src_deftablespace;
115116
volatile Oid dst_deftablespace;
116117
Relation pg_database_rel;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy