diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-03-24 17:22:24 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-03-24 17:22:24 -0400 |
commit | a376960c8f8ec08783e1c529f36fbeb60236b378 (patch) | |
tree | c6bb56dd167c44f0e28d9fc3a77030a974301252 | |
parent | 0ecd3fedfcf3427ebeb73cc61b2fcf6ed67c43a2 (diff) | |
download | postgresql-a376960c8f8ec08783e1c529f36fbeb60236b378.tar.gz postgresql-a376960c8f8ec08783e1c529f36fbeb60236b378.zip |
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.
-rw-r--r-- | src/backend/commands/amcmds.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/backend/commands/amcmds.c b/src/backend/commands/amcmds.c index 7a937543916..68ea5f3c583 100644 --- a/src/backend/commands/amcmds.c +++ b/src/backend/commands/amcmds.c @@ -30,7 +30,7 @@ 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) } /* - * 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) { switch (amtype) @@ -229,6 +229,7 @@ get_am_type_string(char amtype) default: /* shouldn't happen */ elog(ERROR, "invalid access method type '%c'", amtype); + return NULL; /* keep compiler quiet */ } } |