Use explicit cast between void* and pointer-to-function.
authorPaul Smith <psmith@gnu.org>
Sun, 22 Sep 2013 16:31:35 +0000 (12:31 -0400)
committerPaul Smith <psmith@gnu.org>
Sun, 22 Sep 2013 21:10:35 +0000 (17:10 -0400)
ChangeLog
guile.c
load.c

index 5b0fcb59a2608cc4e19797af9a2daada9bfe93fb..816a2ad23a1da229e357ae73713c76e83ae259a4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2013-09-22  Paul Smith  <psmith@gnu.org>
 
+       * guile.c (guile_define_module): Technically a void* cannot
+       contain a pointer-to-function and some compilers warn about this.
+       Cast the function pointers.
+       * load.c (load_object): Ditto.
+
        * read.c (eval): If load_file() returns -1, don't add this to the
        "to be rebuilt" list.
        * doc/make.texi (load Directive): Document it.
diff --git a/guile.c b/guile.c
index 20e58d4b5abe975e9d12ca9ca1c27212393ba601..9c9bf5c44b8701d73ca37cbf108619013251f450 100644 (file)
--- a/guile.c
+++ b/guile.c
@@ -72,10 +72,10 @@ guile_define_module (void *data UNUSED)
 #include "gmk-default.h"
 
   /* Register a subr for GNU make's eval capability.  */
-  scm_c_define_gsubr ("gmk-expand", 1, 0, 0, guile_expand_wrapper);
+  scm_c_define_gsubr ("gmk-expand", 1, 0, 0, (scm_t_subr) guile_expand_wrapper);
 
   /* Register a subr for GNU make's eval capability.  */
-  scm_c_define_gsubr ("gmk-eval", 1, 0, 0, guile_eval_wrapper);
+  scm_c_define_gsubr ("gmk-eval", 1, 0, 0, (scm_t_subr) guile_eval_wrapper);
 
   /* Define the rest of the module.  */
   scm_c_eval_string (GUILE_module_defn);
diff --git a/load.c b/load.c
index 165153a4c9aa449d92024fb739f12cfbd9af761d..a2cbc25b0d9916ff2ba5c08bcc6a753c778fe9ea 100644 (file)
--- a/load.c
+++ b/load.c
@@ -82,12 +82,12 @@ load_object (const gmk_floc *flocp, int noerror,
         }
 
       /* Assert that the GPL license symbol is defined.  */
-      symp = dlsym (dlp, "plugin_is_GPL_compatible");
+      symp = (load_func_t) dlsym (dlp, "plugin_is_GPL_compatible");
       if (! symp)
         fatal (flocp, _("Loaded object %s is not declared to be GPL compatible"),
                ldname);
 
-      symp = dlsym (dlp, symname);
+      symp = (load_func_t) dlsym (dlp, symname);
       if (! symp)
         fatal (flocp, _("Failed to load symbol %s from %s: %s"),
                symname, ldname, dlerror ());