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
9137703d
Commit
9137703d
authored
4 years ago
by
Allan Blanchard
Browse files
Options
Downloads
Patches
Plain Diff
[wp/doc] wp_nullable / wp_nullable_args
parent
d892bdaa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/wp/doc/manual/nullable.c
+9
-0
9 additions, 0 deletions
src/plugins/wp/doc/manual/nullable.c
src/plugins/wp/doc/manual/wp_caveat.tex
+9
-2
9 additions, 2 deletions
src/plugins/wp/doc/manual/wp_caveat.tex
with
18 additions
and
2 deletions
src/plugins/wp/doc/manual/nullable.c
0 → 100644
+
9
−
0
View file @
9137703d
void
foo
(
int
*
p
/*@ wp_nullable */
,
int
*
q
/*@ wp_nullable */
){
}
// or equivalently:
//@ wp_nullable_args p, q ;
void
foo
(
int
*
p
,
int
*
q
){
}
This diff is collapsed.
Click to expand it.
src/plugins/wp/doc/manual/wp_caveat.tex
+
9
−
2
View file @
9137703d
...
...
@@ -21,7 +21,14 @@ global ones).
Additionally, the
\texttt
{
Caveat
}
memory model of
\textsf
{
Frama-C
}
performs a local allocation of formal parameters with pointer
types that cannot be treated as
\textit
{
reference parameters
}
.
types that cannot be treated as
\textit
{
reference parameters
}
.
Note that it means that the pointer is considered valid. If one needs
to accept
\texttt
{
NULL
}
for this pointer, a
\texttt
{
wp
\_
nullable
}
ghost
annotation or the clause
\texttt
{
wp
\_
nullage
\_
args
}
can be used to bring
this information to WP:
\listingname
{
nullable.c
}
\cinput
{
nullable.c
}
This makes explicit the separation hypothesis of memory regions
pointed by formals in the
\textsf
{
Caveat
}
tool. The major benefit of
...
...
@@ -29,7 +36,7 @@ the \textsf{WP} version is that aliases are taken into account by the
\texttt
{
Typed
}
memory model, hence, there are no more suspicious
\textit
{
aliasing
}
warnings.
\paragraph
{
Warning:
}
using the
\texttt
{
Caveat
}
memory model,
\paragraph
{
Warning:
}
using the
\texttt
{
Caveat
}
memory model,
the user
\emph
{
must
}
check by manual code review that no aliases are
introduced
\emph
{
via
}
pointers passed to formal parameters at call sites.
...
...
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