summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-08-28 13:43:16 +0200
committerJim Meyering <meyering@redhat.com>2009-08-28 13:43:16 +0200
commit23740528cd2d75a236aae1fb5d073e8be2e5a295 (patch)
tree189c7bb84ddf3ee6bc401a91a1f8673c2a15b3c1 /src
parente933691fd1c1a5543c05fcd209ce57daf6cac4f7 (diff)
downloadlibguestfs-23740528cd2d75a236aae1fb5d073e8be2e5a295.tar.gz
libguestfs-23740528cd2d75a236aae1fb5d073e8be2e5a295.tar.xz
libguestfs-23740528cd2d75a236aae1fb5d073e8be2e5a295.zip
generator.ml: avoid warnings in generated ocaml/guestfs_c_actions.c
* src/generator.ml: Emit prototypes for ocaml_guestfs_* functions, to avoid warnings from gcc -Wmissing-prototypes. Normally we'd put these somewhere else, but in this unusual case, they're not needed anywhere else. Handle the >5-argument case, too, for these: ocaml_guestfs_test0_byte, ocaml_guestfs_sfdisk_byte, ocaml_guestfs_sfdisk_N_byte.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/generator.ml7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/generator.ml b/src/generator.ml
index 46fcf2cc..fa7d240e 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -6770,6 +6770,10 @@ copy_table (char * const * argv)
let needs_extra_vs =
match fst style with RConstOptString _ -> true | _ -> false in
+ pr "/* Emit prototype to appease gcc's -Wmissing-prototypes. */\n";
+ pr "CAMLprim value ocaml_guestfs_%s (value %s" name (List.hd params);
+ List.iter (pr ", value %s") (List.tl params); pr ");\n";
+
pr "CAMLprim value\n";
pr "ocaml_guestfs_%s (value %s" name (List.hd params);
List.iter (pr ", value %s") (List.tl params);
@@ -6903,6 +6907,9 @@ copy_table (char * const * argv)
pr "\n";
if List.length params > 5 then (
+ pr "/* Emit prototype to appease gcc's -Wmissing-prototypes. */\n";
+ pr "CAMLprim value ";
+ pr "ocaml_guestfs_%s_byte (value *argv, int argn);\n" name;
pr "CAMLprim value\n";
pr "ocaml_guestfs_%s_byte (value *argv, int argn)\n" name;
pr "{\n";