aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2018-10-23 14:35:59 +0200
committerPeter Eisentraut <peter_e@gmx.net>2018-10-23 14:35:59 +0200
commite6f5d1accd3ae170a0baa632bfe3396bdd9b6e92 (patch)
treed3b507808b6e3b4b3b10ec5cff68fd35901b74a8
parent807e4bc828cff0645d2a776604dc7cdc733b2fd3 (diff)
downloadpostgresql-e6f5d1accd3ae170a0baa632bfe3396bdd9b6e92.tar.gz
postgresql-e6f5d1accd3ae170a0baa632bfe3396bdd9b6e92.zip
Drop const cast from dlsym() calls
This workaround might be obsolete. We'll see if those "older platforms" mentioned in the comment are still around. Discussion: https://www.postgresql.org/message-id/08adbe4e-38f8-2c73-55f0-591392371687%402ndquadrant.com
-rw-r--r--src/backend/utils/fmgr/dfmgr.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/backend/utils/fmgr/dfmgr.c b/src/backend/utils/fmgr/dfmgr.c
index 4a5cc7cfc7f..04c8aa8eef0 100644
--- a/src/backend/utils/fmgr/dfmgr.c
+++ b/src/backend/utils/fmgr/dfmgr.c
@@ -121,12 +121,8 @@ load_external_function(const char *filename, const char *funcname,
if (filehandle)
*filehandle = lib_handle;
- /*
- * Look up the function within the library. According to POSIX dlsym()
- * should declare its second argument as "const char *", but older
- * platforms might not, so for the time being we just cast away const.
- */
- retval = (PGFunction) dlsym(lib_handle, (char *) funcname);
+ /* Look up the function within the library. */
+ retval = (PGFunction) dlsym(lib_handle, funcname);
if (retval == NULL && signalNotFound)
ereport(ERROR,
@@ -174,8 +170,7 @@ load_file(const char *filename, bool restricted)
PGFunction
lookup_external_function(void *filehandle, const char *funcname)
{
- /* as above, cast away const for the time being */
- return (PGFunction) dlsym(filehandle, (char *) funcname);
+ return (PGFunction) dlsym(filehandle, funcname);
}