Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
ccan
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mirror
ccan
Commits
c9d946d0
Commit
c9d946d0
authored
May 26, 2014
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools/ccanlint: detect more unmentioned dependencies.
Signed-off-by:
Rusty Russell
<
rusty@rustcorp.com.au
>
parent
925a9a86
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
8 deletions
+17
-8
tools/ccanlint/tests/depends_accurate.c
tools/ccanlint/tests/depends_accurate.c
+4
-5
tools/ccanlint/tests/headers_idempotent.c
tools/ccanlint/tests/headers_idempotent.c
+8
-3
tools/manifest.c
tools/manifest.c
+2
-0
tools/manifest.h
tools/manifest.h
+3
-0
No files found.
tools/ccanlint/tests/depends_accurate.c
View file @
c9d946d0
...
...
@@ -53,10 +53,9 @@ static bool check_dep_includes(struct manifest *m,
if
(
has_dep
(
m
,
deps
,
used
,
mod
))
continue
;
/* FIXME: we can't be sure about
* conditional includes, so don't
* complain. */
if
(
!
li
[
i
].
cond
)
{
/* FIXME: we can't be sure about conditional includes,
* so don't complain (handle common case of idempotent wrap) */
if
(
!
li
[
i
].
cond
||
li
[
i
].
cond
==
f
->
idempotent_cond
)
{
score_file_error
(
score
,
f
,
i
+
1
,
"%s not listed in _info"
,
mod
);
ok
=
false
;
...
...
@@ -138,7 +137,7 @@ struct ccanlint depends_accurate = {
.
key
=
"depends_accurate"
,
.
name
=
"Module's CCAN dependencies are the only CCAN files #included"
,
.
check
=
check_depends_accurate
,
.
needs
=
"depends_exist test_depends_exist"
.
needs
=
"depends_exist test_depends_exist
headers_idempotent
"
};
REGISTER_TEST
(
depends_accurate
);
tools/ccanlint/tests/headers_idempotent.c
View file @
c9d946d0
...
...
@@ -125,9 +125,10 @@ static void check_idem(struct ccan_file *f, struct score *score)
if
(
!
f
->
lines
[
i
])
return
;
/* We expect a condition
on
this line. */
/* We expect a condition
around
this line. */
if
(
!
line_info
[
i
].
cond
)
{
score_file_error
(
score
,
f
,
i
+
1
,
"Expected #ifndef"
);
score_file_error
(
score
,
f
,
first_preproc_line
+
1
,
"Expected #ifndef"
);
return
;
}
...
...
@@ -136,7 +137,8 @@ static void check_idem(struct ccan_file *f, struct score *score)
/* We expect the condition to be ! IFDEF <symbol>. */
if
(
line_info
[
i
].
cond
->
type
!=
PP_COND_IFDEF
||
!
line_info
[
i
].
cond
->
inverse
)
{
score_file_error
(
score
,
f
,
i
+
1
,
"Expected #ifndef"
);
score_file_error
(
score
,
f
,
first_preproc_line
+
1
,
"Expected #ifndef"
);
return
;
}
...
...
@@ -157,6 +159,9 @@ static void check_idem(struct ccan_file *f, struct score *score)
return
;
}
/* Record this for use in depends_accurate */
f
->
idempotent_cond
=
line_info
[
i
].
cond
;
/* Rest of code should all be covered by that conditional. */
for
(
i
++
;
f
->
lines
[
i
];
i
++
)
{
unsigned
int
val
=
0
;
...
...
tools/manifest.c
View file @
c9d946d0
...
...
@@ -78,6 +78,8 @@ struct ccan_file *new_ccan_file(const void *ctx, const char *dir,
f
->
fullname
=
path_join
(
f
,
dir
,
f
->
name
);
f
->
contents
=
NULL
;
f
->
simplified
=
NULL
;
f
->
idempotent_cond
=
NULL
;
return
f
;
}
...
...
tools/manifest.h
View file @
c9d946d0
...
...
@@ -80,6 +80,9 @@ struct ccan_file {
/* Simplified stream (lowercase letters and single spaces) */
char
*
simplified
;
/* Condition for idempotent wrapper (filled by headers_idempotent) */
struct
pp_conditions
*
idempotent_cond
;
};
/* A new ccan_file, with the given dir and name (either can be take()). */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment