Skip to content
Snippets Groups Projects
Commit 4c30ce44 authored by David Bühler's avatar David Bühler
Browse files

[Kernel] Adds the new option -warn-pointer-downcast.

parent 4ff61255
No related branches found
No related tags found
No related merge requests found
......@@ -1440,6 +1440,17 @@ module UnsignedDowncast =
destination range"
end)
(* Pointer downcasts are undefined behaviors. *)
let () = Parameter_customize.set_group analysis_options
let () = Parameter_customize.do_not_reset_on_copy ()
module PointerDowncast =
True
(struct
let module_name = "PointerDowncast"
let option_name = "-warn-pointer-downcast"
let help = "generate alarms when a pointer is converted into an integer \
but may not be in the range of the destination type."
end)
(* Not finite floats are ok, but might not always be a behavior the programmer
wants. *)
......
......@@ -540,6 +540,9 @@ module SignedDowncast: Parameter_sig.Bool
module UnsignedDowncast: Parameter_sig.Bool
(** Behavior of option "-warn-unsigned-downcast" *)
module PointerDowncast: Parameter_sig.Bool
(** Behavior of option "-warn-pointer-downcast" *)
module SpecialFloat: Parameter_sig.String
(** Behavior of option "-warn-special-float" *)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment