diff --git a/Makefile b/Makefile index 6d0eb06c3..f09a8b066 100644 --- a/Makefile +++ b/Makefile @@ -32,6 +32,7 @@ BUILD_SYSTEMS_TESTS += \ clang_with_E_flag \ clang_with_M_flag \ clang_with_MD_flag \ + deduplicate_template_warnings \ delete_results_dir \ diff \ diff_gen_build_script \ diff --git a/infer/src/backend/InferPrint.ml b/infer/src/backend/InferPrint.ml index a65050465..0f25e4596 100644 --- a/infer/src/backend/InferPrint.ml +++ b/infer/src/backend/InferPrint.ml @@ -731,11 +731,13 @@ module Issue = struct let compare_err_data_ (err_data1: Errlog.err_data) (err_data2: Errlog.err_data) = Location.compare err_data1.loc err_data2.loc + type proc_name_ = Typ.Procname.t + + (* ignore proc name *) + let compare_proc_name_ _ _ = 0 + type t = - { proc_name: Typ.Procname.t [@compare.ignore ] - ; proc_location: Location.t - ; err_key: Errlog.err_key - ; err_data: err_data_ } + {proc_name: proc_name_; proc_location: Location.t; err_key: Errlog.err_key; err_data: err_data_} [@@deriving compare] (* If two issues are identical except for their procnames, they are probably duplicate reports on diff --git a/infer/tests/codetoanalyze/cpp/errors/issues.exp b/infer/tests/codetoanalyze/cpp/errors/issues.exp index 02e8ad248..21d58287a 100644 --- a/infer/tests/codetoanalyze/cpp/errors/issues.exp +++ b/infer/tests/codetoanalyze/cpp/errors/issues.exp @@ -1,7 +1,4 @@ INFER_MODEL/cpp/include/infer_model/shared_ptr.h, std::make_shared, 1, MEMORY_LEAK, [start of procedure std::make_shared(),Skipping lol: function or method not found] -INFER_MODEL/cpp/include/infer_model/shared_ptr.h, std::make_shared, 1, MEMORY_LEAK, [start of procedure std::make_shared(),start of procedure Base,return from a call to weak_ptr_constructors::Base_Base,start of procedure Base,return from a call to weak_ptr_constructors::Base_Base] -INFER_MODEL/cpp/include/infer_model/shared_ptr.h, std::make_shared, 1, MEMORY_LEAK, [start of procedure std::make_shared(),start of procedure Derived,start of procedure Base,return from a call to weak_ptr_constructors::Base_Base,return from a call to weak_ptr_constructors::Derived_Derived,start of procedure Derived,start of procedure Base,return from a call to weak_ptr_constructors::Base_Base,return from a call to weak_ptr_constructors::Derived_Derived] -INFER_MODEL/cpp/include/infer_model/shared_ptr.h, std::make_shared, 1, MEMORY_LEAK, [start of procedure std::make_shared(),start of procedure RDC,start of procedure DC,return from a call to weak_ptr_lock_repro_large::DC_DC,return from a call to weak_ptr_lock_repro_large::RDC_RDC,start of procedure RDC,start of procedure DC,return from a call to weak_ptr_lock_repro_large::DC_DC,return from a call to weak_ptr_lock_repro_large::RDC_RDC] codetoanalyze/cpp/errors/c_tests/c_bugs.cpp, crash_fgetc, 4, NULL_DEREFERENCE, [start of procedure crash_fgetc()] codetoanalyze/cpp/errors/c_tests/c_bugs.cpp, crash_getc, 4, NULL_DEREFERENCE, [start of procedure crash_getc()] codetoanalyze/cpp/errors/c_tests/c_bugs.cpp, malloc_fail_gets_reported, 2, NULL_DEREFERENCE, [start of procedure malloc_fail_gets_reported()] @@ -11,9 +8,7 @@ codetoanalyze/cpp/errors/c_tests/c_bugs.cpp, resource_leak_is_reported, 0, RESOU codetoanalyze/cpp/errors/include_header/header.h, header::A_div0, 0, DIVIDE_BY_ZERO, [start of procedure div0] codetoanalyze/cpp/errors/include_header/header.h, header::div0_fun, 0, DIVIDE_BY_ZERO, [start of procedure header::div0_fun()] codetoanalyze/cpp/errors/include_header/header2.h, header2::B_div0, 0, DIVIDE_BY_ZERO, [start of procedure div0] -codetoanalyze/cpp/errors/include_header/header2.h, header2::B_div0, 0, DIVIDE_BY_ZERO, [start of procedure div0] codetoanalyze/cpp/errors/include_header/header2.h, header2::div0_templ, 1, DIVIDE_BY_ZERO, [start of procedure header2::div0_templ()] -codetoanalyze/cpp/errors/include_header/header2.h, header2::div0_templ, 1, DIVIDE_BY_ZERO, [start of procedure header2::div0_templ()] codetoanalyze/cpp/errors/memory_leaks/array_leak.cpp, leak, 1, MEMORY_LEAK, [start of procedure leak()] codetoanalyze/cpp/errors/memory_leaks/array_leak.cpp, leak, 2, DANGLING_POINTER_DEREFERENCE, [start of procedure leak()] codetoanalyze/cpp/errors/memory_leaks/array_leak.cpp, no_leak, 1, MEMORY_LEAK, [start of procedure no_leak()]