Some of our port-specific dynloader implementations are careful to
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 12 Jul 2007 21:13:27 +0000 (21:13 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 12 Jul 2007 21:13:27 +0000 (21:13 +0000)
define pg_dlsym() as returning a PGFunction pointer, not just any
pointer-to-function.  But many are not.  Suppress compiler warnings
on platforms that aren't careful by inserting explicit casts at the
two call sites that didn't have a cast already.  Per Stefan.

src/backend/utils/fmgr/dfmgr.c

index d3dc65475b72ef081776cb5d1104c6d8c22ffccc..ec3743b130b453e84f3b87e9f2c31d1d136c7515 100644 (file)
@@ -114,7 +114,7 @@ load_external_function(char *filename, char *funcname,
                *filehandle = lib_handle;
 
        /* Look up the function within the library */
-       retval = pg_dlsym(lib_handle, funcname);
+       retval = (PGFunction) pg_dlsym(lib_handle, funcname);
 
        if (retval == NULL && signalNotFound)
                ereport(ERROR,
@@ -162,7 +162,7 @@ load_file(const char *filename, bool restricted)
 PGFunction
 lookup_external_function(void *filehandle, char *funcname)
 {
-       return pg_dlsym(filehandle, funcname);
+       return (PGFunction) pg_dlsym(filehandle, funcname);
 }