Fix some compiler warnings on older compilers

Some older compilers appear to not understand the recently introduced
PG_FINALLY code structure that well in some circumstances and complain
about possibly uninitialized variables.  So to fix, initialize the
variables explicitly in the cases complained about.

Discussion: https://www.postgresql.org/message-id/flat/95a822c3-728b-af0e-d7e5-71890507ae0c%402ndquadrant.com
This commit is contained in:
Peter Eisentraut 2019-11-04 11:07:32 +01:00
parent 8557a6f10c
commit a63c84e59a
5 changed files with 5 additions and 5 deletions

View File

@ -3821,7 +3821,7 @@ SPI_sql_row_to_xmlelement(uint64 rownum, StringInfo result, char *tablename,
static text *
xml_xmlnodetoxmltype(xmlNodePtr cur, PgXmlErrorContext *xmlerrcxt)
{
xmltype *result;
xmltype *result = NULL;
if (cur->type != XML_ATTRIBUTE_NODE && cur->type != XML_TEXT_NODE)
{

View File

@ -1840,7 +1840,7 @@ PG_FUNCTION_INFO_V1(plperl_call_handler);
Datum
plperl_call_handler(PG_FUNCTION_ARGS)
{
Datum retval;
Datum retval = (Datum) 0;
plperl_call_data *volatile save_call_data = current_call_data;
plperl_interp_desc *volatile oldinterp = plperl_active_interp;
plperl_call_data this_call_data;

View File

@ -1025,7 +1025,7 @@ plpython_trigger_error_callback(void *arg)
static PyObject *
PLy_procedure_call(PLyProcedure *proc, const char *kargs, PyObject *vargs)
{
PyObject *rv;
PyObject *rv = NULL;
int volatile save_subxact_level = list_length(explicit_subtransactions);
PyDict_SetItemString(proc->globals, kargs, vargs);

View File

@ -901,7 +901,7 @@ PLyObject_ToBytea(PLyObToDatum *arg, PyObject *plrv,
bool *isnull, bool inarray)
{
PyObject *volatile plrv_so = NULL;
Datum rv;
Datum rv = (Datum) 0;
if (plrv == Py_None)
{

View File

@ -718,7 +718,7 @@ pltclu_call_handler(PG_FUNCTION_ARGS)
static Datum
pltcl_handler(PG_FUNCTION_ARGS, bool pltrusted)
{
Datum retval;
Datum retval = (Datum) 0;
pltcl_call_state current_call_state;
pltcl_call_state *save_call_state;