Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
4c30ce44
Commit
4c30ce44
authored
5 years ago
by
David Bühler
Browse files
Options
Downloads
Patches
Plain Diff
[Kernel] Adds the new option -warn-pointer-downcast.
parent
4ff61255
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/kernel_services/plugin_entry_points/kernel.ml
+11
-0
11 additions, 0 deletions
src/kernel_services/plugin_entry_points/kernel.ml
src/kernel_services/plugin_entry_points/kernel.mli
+3
-0
3 additions, 0 deletions
src/kernel_services/plugin_entry_points/kernel.mli
with
14 additions
and
0 deletions
src/kernel_services/plugin_entry_points/kernel.ml
+
11
−
0
View file @
4c30ce44
...
...
@@ -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. *)
...
...
This diff is collapsed.
Click to expand it.
src/kernel_services/plugin_entry_points/kernel.mli
+
3
−
0
View file @
4c30ce44
...
...
@@ -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" *)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment