Commit a376960c authored by Tom Lane's avatar Tom Lane

Suppress compiler warning for get_am_type_string().

Compilers that don't know that elog(ERROR) doesn't return complained
that this function might fail to return a value.  Per buildfarm.

While at it, const-ify the function's declaration, since the intent
is evidently to always return a constant string.
parent 0ecd3fed
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
static Oid lookup_index_am_handler_func(List *handler_name, char amtype); static Oid lookup_index_am_handler_func(List *handler_name, char amtype);
static char *get_am_type_string(char amtype); static const char *get_am_type_string(char amtype);
/* /*
...@@ -217,9 +217,9 @@ get_am_name(Oid amOid) ...@@ -217,9 +217,9 @@ get_am_name(Oid amOid)
} }
/* /*
* Convert single charater access method type into string for error reporting. * Convert single-character access method type into string for error reporting.
*/ */
static char * static const char *
get_am_type_string(char amtype) get_am_type_string(char amtype)
{ {
switch (amtype) switch (amtype)
...@@ -229,6 +229,7 @@ get_am_type_string(char amtype) ...@@ -229,6 +229,7 @@ get_am_type_string(char amtype)
default: default:
/* shouldn't happen */ /* shouldn't happen */
elog(ERROR, "invalid access method type '%c'", amtype); elog(ERROR, "invalid access method type '%c'", amtype);
return NULL; /* keep compiler quiet */
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment