Skip to content

Commit a376960

Browse files
committed
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.
1 parent 0ecd3fe commit a376960

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/backend/commands/amcmds.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131

3232
static Oid lookup_index_am_handler_func(List *handler_name, char amtype);
33-
static char *get_am_type_string(char amtype);
33+
static const char *get_am_type_string(char amtype);
3434

3535

3636
/*
@@ -217,9 +217,9 @@ get_am_name(Oid amOid)
217217
}
218218

219219
/*
220-
* Convert single charater access method type into string for error reporting.
220+
* Convert single-character access method type into string for error reporting.
221221
*/
222-
static char *
222+
static const char *
223223
get_am_type_string(char amtype)
224224
{
225225
switch (amtype)
@@ -229,6 +229,7 @@ get_am_type_string(char amtype)
229229
default:
230230
/* shouldn't happen */
231231
elog(ERROR, "invalid access method type '%c'", amtype);
232+
return NULL; /* keep compiler quiet */
232233
}
233234
}
234235

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