Improving the line number information in the string delegate warning check

Summary: public We are not assigning the location of the property rather than that of the class. It seems that it's no problem having the bugs reported in the .h files.

Reviewed By: ddino

Differential Revision: D2831226

fb-gh-sync-id: 026692e
master
Dulma Rodriguez 9 years ago committed by facebook-github-bot-1
parent 1fc7d4c0a3
commit c88ac54613

@ -61,7 +61,7 @@ let rec translate_one_declaration tenv cg cfg parent_dec dec =
| Some ObjCCategoryDecl(_, _, cat_decl_list, _, _) -> | Some ObjCCategoryDecl(_, _, cat_decl_list, _, _) ->
let name = CContext.get_curr_class_name curr_class in let name = CContext.get_curr_class_name curr_class in
let decls = cat_decl_list @ decl_list in let decls = cat_decl_list @ decl_list in
CFrontend_errors.check_for_property_errors cfg cg tenv name decl_info decls CFrontend_errors.check_for_property_errors cfg cg tenv name decls
| _ -> ()) | _ -> ())
| ObjCImplementationDecl(decl_info, name_info, decl_list, decl_context_info, idi) -> | ObjCImplementationDecl(decl_info, name_info, decl_list, decl_context_info, idi) ->
@ -73,7 +73,7 @@ let rec translate_one_declaration tenv cg cfg parent_dec dec =
| Some ObjCInterfaceDecl(_, _, cl_decl_list, _, _) -> | Some ObjCInterfaceDecl(_, _, cl_decl_list, _, _) ->
let name = CContext.get_curr_class_name curr_class in let name = CContext.get_curr_class_name curr_class in
let decls = cl_decl_list @ decl_list in let decls = cl_decl_list @ decl_list in
CFrontend_errors.check_for_property_errors cfg cg tenv name decl_info decls CFrontend_errors.check_for_property_errors cfg cg tenv name decls
| _ -> ()) | _ -> ())
| CXXMethodDecl (decl_info, name_info, type_ptr, function_decl_info, _) | CXXMethodDecl (decl_info, name_info, type_ptr, function_decl_info, _)

@ -39,7 +39,7 @@ let log_frontend_warning pdesc warn_desc =
Reporting.log_error_from_errlog errlog exn ~loc:(Some loc) Reporting.log_error_from_errlog errlog exn ~loc:(Some loc)
(* Call all checkers on properties of class c *) (* Call all checkers on properties of class c *)
let rec check_for_property_errors cfg cg tenv class_name class_decl_info decl_list = let rec check_for_property_errors cfg cg tenv class_name decl_list =
let open Clang_ast_t in let open Clang_ast_t in
let do_one_property decl_info pname_info pdi = let do_one_property decl_info pname_info pdi =
IList.iter (fun checker -> IList.iter (fun checker ->
@ -52,9 +52,9 @@ let rec check_for_property_errors cfg cg tenv class_name class_decl_info decl_li
| [] -> () | [] -> ()
| ObjCPropertyDecl (decl_info, pname_info, pdi) :: rest -> | ObjCPropertyDecl (decl_info, pname_info, pdi) :: rest ->
do_one_property decl_info pname_info pdi; do_one_property decl_info pname_info pdi;
check_for_property_errors cfg cg tenv class_name class_decl_info rest check_for_property_errors cfg cg tenv class_name rest
| _ :: rest -> | _ :: rest ->
check_for_property_errors cfg cg tenv class_name class_decl_info rest check_for_property_errors cfg cg tenv class_name rest
(* Call checkers on a specific access of an ivar *) (* Call checkers on a specific access of an ivar *)
let check_for_ivar_errors context stmt_info obj_c_ivar_ref_expr_info = let check_for_ivar_errors context stmt_info obj_c_ivar_ref_expr_info =

@ -12,8 +12,8 @@
(* Checks for warnings on properties of class c *) (* Checks for warnings on properties of class c *)
val check_for_property_errors : Cfg.cfg -> Cg.t -> Sil.tenv -> string -> Clang_ast_t.decl_info -> val check_for_property_errors : Cfg.cfg -> Cg.t -> Sil.tenv -> string -> Clang_ast_t.decl list ->
Clang_ast_t.decl list -> unit unit
(* Call checkers on a specific access of an ivar *) (* Call checkers on a specific access of an ivar *)
val check_for_ivar_errors : val check_for_ivar_errors :

Loading…
Cancel
Save