Warn of unused open statements

Summary: public

Reviewed By: jeremydubreil

Differential Revision: D2938325

fb-gh-sync-id: d12d34b
shipit-source-id: d12d34b
master
Josh Berdine 9 years ago committed by facebook-github-bot-7
parent b155168083
commit 55cb61dbda

@ -91,6 +91,7 @@ OCAMLBUILD_OPTIONS = \
-cflags -w,@19 \ -cflags -w,@19 \
-cflags -w,@20 \ -cflags -w,@20 \
-cflags -w,@26 \ -cflags -w,@26 \
-cflags -w,@33 \
-cflags -w,@34 \ -cflags -w,@34 \
-cflags -w,@35 \ -cflags -w,@35 \
-cflags -w,@37 \ -cflags -w,@37 \

@ -12,7 +12,6 @@
module L = Logging module L = Logging
module F = Format module F = Format
open Yojson.Basic.Util
(* This module, unused by default, generates random c files with procedure calls *) (* This module, unused by default, generates random c files with procedure calls *)
module Codegen = struct module Codegen = struct

@ -12,7 +12,6 @@
module L = Logging module L = Logging
module F = Format module F = Format
open Str
type java_type = string option * string (* e.g. ("", "int") for primitive types or ("java.io", "PrintWriter") for objects *) type java_type = string option * string (* e.g. ("", "int") for primitive types or ("java.io", "PrintWriter") for objects *)

@ -10,7 +10,6 @@
(** Functions for Theorem Proving *) (** Functions for Theorem Proving *)
open Ident
open Sil open Sil
(** {2 Ordinary Theorem Proving} *) (** {2 Ordinary Theorem Proving} *)

@ -10,7 +10,6 @@
(** Contains current class and current method to be translated as well as local variables, *) (** Contains current class and current method to be translated as well as local variables, *)
(** and the cg, cfg, and tenv corresponding to the current file. *) (** and the cg, cfg, and tenv corresponding to the current file. *)
open CFrontend_utils
module L = Logging module L = Logging
type curr_class = type curr_class =

@ -9,6 +9,5 @@
(** Translate an enumeration declaration by adding it to the tenv and *) (** Translate an enumeration declaration by adding it to the tenv and *)
(** translating the code and adding it to a fake procdesc *) (** translating the code and adding it to a fake procdesc *)
open CFrontend_utils
val enum_decl : Clang_ast_t.decl -> Sil.typ val enum_decl : Clang_ast_t.decl -> Sil.typ

@ -560,7 +560,6 @@ struct
{ empty_res_trans with root_nodes = [root_node']; leaf_nodes = trans_state.succ_nodes } { empty_res_trans with root_nodes = [root_node']; leaf_nodes = trans_state.succ_nodes }
and decl_ref_trans trans_state pre_trans_result stmt_info decl_ref = and decl_ref_trans trans_state pre_trans_result stmt_info decl_ref =
let open CContext in
Printing.log_out " priority node free = '%s'\n@." Printing.log_out " priority node free = '%s'\n@."
(string_of_bool (PriorityNode.is_priority_free trans_state)); (string_of_bool (PriorityNode.is_priority_free trans_state));
let decl_kind = decl_ref.Clang_ast_t.dr_kind in let decl_kind = decl_ref.Clang_ast_t.dr_kind in
@ -580,7 +579,6 @@ struct
print_error decl_kind; assert false print_error decl_kind; assert false
and declRefExpr_trans trans_state stmt_info expr_info decl_ref_expr_info e = and declRefExpr_trans trans_state stmt_info expr_info decl_ref_expr_info e =
let open CContext in
Printing.log_out " priority node free = '%s'\n@." Printing.log_out " priority node free = '%s'\n@."
(string_of_bool (PriorityNode.is_priority_free trans_state)); (string_of_bool (PriorityNode.is_priority_free trans_state));
let decl_ref = match decl_ref_expr_info.Clang_ast_t.drti_decl_ref with let decl_ref = match decl_ref_expr_info.Clang_ast_t.drti_decl_ref with
@ -1706,7 +1704,6 @@ struct
(* the stmt_list will be [x.f = a; x; a; CallToSetter] Among all element of the list we only need*) (* the stmt_list will be [x.f = a; x; a; CallToSetter] Among all element of the list we only need*)
(* to translate the CallToSetter which is how x.f = a is actually implemented by the runtime.*) (* to translate the CallToSetter which is how x.f = a is actually implemented by the runtime.*)
and pseudoObjectExpr_trans trans_state stmt_info stmt_list = and pseudoObjectExpr_trans trans_state stmt_info stmt_list =
let open Clang_ast_t in
Printing.log_out " priority node free = '%s'\n@." Printing.log_out " priority node free = '%s'\n@."
(string_of_bool (PriorityNode.is_priority_free trans_state)); (string_of_bool (PriorityNode.is_priority_free trans_state));
let rec do_semantic_elements el = let rec do_semantic_elements el =

@ -43,7 +43,6 @@ let add_predefined_objc_types tenv =
(* they should be added here too!! *) (* they should be added here too!! *)
let add_predefined_basic_types tenv = let add_predefined_basic_types tenv =
let open Ast_expressions in let open Ast_expressions in
let open Clang_ast_t in
let add_basic_type tp basic_type_kind = let add_basic_type tp basic_type_kind =
let sil_type = CType_to_sil_type.sil_type_of_builtin_type_kind basic_type_kind in let sil_type = CType_to_sil_type.sil_type_of_builtin_type_kind basic_type_kind in
Ast_utils.update_sil_types_map tp sil_type in Ast_utils.update_sil_types_map tp sil_type in

@ -9,7 +9,6 @@
*) *)
open Javalib_pack open Javalib_pack
open Sawja_pack
module L = Logging module L = Logging

@ -9,7 +9,6 @@
*) *)
open Javalib_pack open Javalib_pack
open Sawja_pack
(** Jar file containing the models *) (** Jar file containing the models *)
val models_jar : string ref val models_jar : string ref

@ -9,7 +9,6 @@
*) *)
open Javalib_pack open Javalib_pack
open Sawja_pack
(** [path_of_cached_classname cn] returns the path of a cached classname *) (** [path_of_cached_classname cn] returns the path of a cached classname *)
val path_of_cached_classname : JBasics.class_name -> string val path_of_cached_classname : JBasics.class_name -> string

@ -8,7 +8,6 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open Javalib_pack
open Sawja_pack open Sawja_pack

@ -8,8 +8,5 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
open Javalib_pack
(** TODO: replace by a Infer-wide debug mode printing *) (** TODO: replace by a Infer-wide debug mode printing *)
val log : ('a, Format.formatter, unit) format -> 'a val log : ('a, Format.formatter, unit) format -> 'a

@ -8,7 +8,6 @@
*) *)
{ {
open Lexing
open LParser open LParser
exception LexingError of string exception LexingError of string

@ -125,7 +125,6 @@ let trans_function_def (cfg : Cfg.cfg) (cg: Cg.t) (metadata : LAst.metadata_map)
| None -> Sil.Tvoid | None -> Sil.Tvoid
| Some ret_tp -> trans_typ ret_tp in | Some ret_tp -> trans_typ ret_tp in
let (proc_attrs : ProcAttributes.t) = let (proc_attrs : ProcAttributes.t) =
let open Sil in
{ (ProcAttributes.default proc_name Config.C_CPP) with { (ProcAttributes.default proc_name Config.C_CPP) with
ProcAttributes.formals = ProcAttributes.formals =
IList.map (fun (tp, name) -> (Mangled.from_string name, trans_typ tp)) params; IList.map (fun (tp, name) -> (Mangled.from_string name, trans_typ tp)) params;

@ -7,8 +7,6 @@
* of patent rights can be found in the PATENTS file in the same directory. * of patent rights can be found in the PATENTS file in the same directory.
*) *)
module L = Logging
(** returns true if [callee_pname] returns a tainted value *) (** returns true if [callee_pname] returns a tainted value *)
let returns_secret callee_pname = false let returns_secret callee_pname = false

Loading…
Cancel
Save