From 303e089df56251ad09e65f92df000e4ace6d82c1 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 24 Sep 2005 22:54:44 +0000 Subject: Clean up possibly-uninitialized-variable warnings reported by gcc 4.x. --- src/backend/commands/functioncmds.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/backend/commands/functioncmds.c') diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c index c2bb4a2d9c8..a2a8f56e23c 100644 --- a/src/backend/commands/functioncmds.c +++ b/src/backend/commands/functioncmds.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.67 2005/09/08 20:07:41 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.68 2005/09/24 22:54:36 tgl Exp $ * * DESCRIPTION * These routines take the parse tree and pick out the @@ -158,6 +158,8 @@ examine_parameter_list(List *parameters, Oid languageOid, ListCell *x; int i; + *requiredResultType = InvalidOid; /* default result */ + inTypes = (Oid *) palloc(parameterCount * sizeof(Oid)); allTypes = (Datum *) palloc(parameterCount * sizeof(Datum)); paramModes = (Datum *) palloc(parameterCount * sizeof(Datum)); @@ -243,7 +245,6 @@ examine_parameter_list(List *parameters, Oid languageOid, { *allParameterTypes = NULL; *parameterModes = NULL; - *requiredResultType = InvalidOid; } if (have_names) @@ -383,16 +384,22 @@ compute_attributes_sql_style(List *options, if (as_item) *as = (List *) as_item->arg; else + { ereport(ERROR, (errcode(ERRCODE_INVALID_FUNCTION_DEFINITION), errmsg("no function body specified"))); + *as = NIL; /* keep compiler quiet */ + } if (language_item) *language = strVal(language_item->arg); else + { ereport(ERROR, (errcode(ERRCODE_INVALID_FUNCTION_DEFINITION), errmsg("no language specified"))); + *language = NULL; /* keep compiler quiet */ + } /* process optional items */ if (volatility_item) -- cgit v1.2.3