From 2e4f4a0c5f1bdfc7dc6ddd9e5371f1b4a417b4a2 Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Tue, 16 Feb 2016 16:24:08 -0800 Subject: [PATCH] Warn of label omitted in function application Summary: public Reviewed By: jvillard Differential Revision: D2938346 fb-gh-sync-id: 50d5c73 shipit-source-id: 50d5c73 --- infer/src/Makefile.in | 1 + infer/src/clang/cMethod_trans.ml | 4 ++-- infer/src/clang/cTrans.ml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/infer/src/Makefile.in b/infer/src/Makefile.in index 6322ba480..80ab775a5 100644 --- a/infer/src/Makefile.in +++ b/infer/src/Makefile.in @@ -82,6 +82,7 @@ OCAMLBUILD_OPTIONS = \ -cflags -strict-formats \ -cflags -strict-sequence \ -cflags -w,@5 \ + -cflags -w,@6 \ -cflags -w,@8 \ -cflags -w,@10 \ -cflags -w,@11 \ diff --git a/infer/src/clang/cMethod_trans.ml b/infer/src/clang/cMethod_trans.ml index ebe3d3d44..028183190 100644 --- a/infer/src/clang/cMethod_trans.ml +++ b/infer/src/clang/cMethod_trans.ml @@ -75,7 +75,7 @@ let get_return_param tenv function_method_decl_info = let is_objc_method = is_objc_method function_method_decl_info in let return_type_ptr = get_original_return_type function_method_decl_info in let return_typ = CTypes_decl.type_ptr_to_sil_type tenv return_type_ptr in - if should_add_return_param return_typ is_objc_method then + if should_add_return_param return_typ ~is_objc_method then [(CFrontend_config.return_param, Ast_expressions.create_pointer_type return_type_ptr)] else [] @@ -114,7 +114,7 @@ let get_return_type tenv function_method_decl_info = let return_type_ptr = get_original_return_type function_method_decl_info in let return_typ = CTypes_decl.type_ptr_to_sil_type tenv return_type_ptr in let is_objc_method = is_objc_method function_method_decl_info in - if should_add_return_param return_typ is_objc_method then + if should_add_return_param return_typ ~is_objc_method then Ast_expressions.create_void_type, Some (Sil.Tptr (return_typ, Sil.Pk_pointer)) else return_type_ptr, None diff --git a/infer/src/clang/cTrans.ml b/infer/src/clang/cTrans.ml index ed89ae6f4..7d00b736c 100644 --- a/infer/src/clang/cTrans.ml +++ b/infer/src/clang/cTrans.ml @@ -259,7 +259,7 @@ struct else [Ident.create_fresh Ident.knormal] in let ret_id', params, initd_exps, ret_exps = (* Assumption: should_add_return_param will return true only for struct types *) - if CMethod_trans.should_add_return_param return_type is_objc_method then + if CMethod_trans.should_add_return_param return_type ~is_objc_method then let param_type = Sil.Tptr (return_type, Sil.Pk_pointer) in let var_exp = match trans_state.var_exp_typ with | Some (exp, _) -> exp