[llvm] d50fe9f - [NFC][OCaml] Resolve a couple more compilation warnings

Josh Berdine via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 26 13:57:59 PDT 2021


Author: Josh Berdine
Date: 2021-03-26T20:56:19Z
New Revision: d50fe9f0d6b9ee61df8830a67ea0a33c27a637e7

URL: https://github.com/llvm/llvm-project/commit/d50fe9f0d6b9ee61df8830a67ea0a33c27a637e7
DIFF: https://github.com/llvm/llvm-project/commit/d50fe9f0d6b9ee61df8830a67ea0a33c27a637e7.diff

LOG: [NFC][OCaml] Resolve a couple more compilation warnings

Followup to: 0b1dc49ca38a [NFC][OCaml] Resolve const and unsigned compilation warnings

Differential Revision: https://reviews.llvm.org/D99420

Added: 
    

Modified: 
    llvm/bindings/ocaml/llvm/llvm_ocaml.c
    llvm/bindings/ocaml/target/target_ocaml.c

Removed: 
    


################################################################################
diff  --git a/llvm/bindings/ocaml/llvm/llvm_ocaml.c b/llvm/bindings/ocaml/llvm/llvm_ocaml.c
index a7e449abcd94..04bc06e65b75 100644
--- a/llvm/bindings/ocaml/llvm/llvm_ocaml.c
+++ b/llvm/bindings/ocaml/llvm/llvm_ocaml.c
@@ -885,7 +885,7 @@ CAMLprim LLVMValueRef llvm_mdnull(LLVMContextRef C) {
 
 /* llvalue -> string option */
 CAMLprim value llvm_get_mdstring(LLVMValueRef V) {
-  size_t Len;
+  unsigned Len;
   const char *CStr = LLVMGetMDString(V, &Len);
   return cstr_to_string_option(CStr, Len);
 }

diff  --git a/llvm/bindings/ocaml/target/target_ocaml.c b/llvm/bindings/ocaml/target/target_ocaml.c
index cf48fbe45730..b19f6337e368 100644
--- a/llvm/bindings/ocaml/target/target_ocaml.c
+++ b/llvm/bindings/ocaml/target/target_ocaml.c
@@ -314,8 +314,8 @@ CAMLprim value llvm_targetmachine_emit_to_file(LLVMModuleRef Module,
   char *ErrorMessage;
 
   if(LLVMTargetMachineEmitToFile(TargetMachine_val(Machine), Module,
-                                 String_val(FileName), Int_val(FileType),
-                                 &ErrorMessage)) {
+                                 (char *)String_val(FileName),
+                                 Int_val(FileType), &ErrorMessage)) {
     llvm_raise(*caml_named_value("Llvm_target.Error"), ErrorMessage);
   }
 


        


More information about the llvm-commits mailing list