mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
[PATCH] DocBook: warn for missing macro parameters
Previously kernel-doc silently ignored missing parameter descriptions for preprocessor macros. Now that all such omissions are fixed up we can warn about them in kernel-doc to be able to keep it that way. Signed-off-by: Martin Waitz <tali@admingilde.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
0863afb32b
commit
a6d3fe77da
1 changed files with 8 additions and 4 deletions
|
@ -1405,6 +1405,7 @@ sub create_parameterlist($$$) {
|
||||||
my $type;
|
my $type;
|
||||||
my $param;
|
my $param;
|
||||||
|
|
||||||
|
# temporarily replace commas inside function pointer definition
|
||||||
while ($args =~ /(\([^\),]+),/) {
|
while ($args =~ /(\([^\),]+),/) {
|
||||||
$args =~ s/(\([^\),]+),/$1#/g;
|
$args =~ s/(\([^\),]+),/$1#/g;
|
||||||
}
|
}
|
||||||
|
@ -1465,11 +1466,10 @@ sub push_parameter($$$) {
|
||||||
my $param_name = $param;
|
my $param_name = $param;
|
||||||
$param_name =~ s/\[.*//;
|
$param_name =~ s/\[.*//;
|
||||||
|
|
||||||
if ($type eq "" && $param eq "...")
|
if ($type eq "" && $param =~ /\.\.\.$/)
|
||||||
{
|
{
|
||||||
$type="";
|
$type="";
|
||||||
$param="...";
|
$parameterdescs{$param} = "variable arguments";
|
||||||
$parameterdescs{"..."} = "variable arguments";
|
|
||||||
}
|
}
|
||||||
elsif ($type eq "" && ($param eq "" or $param eq "void"))
|
elsif ($type eq "" && ($param eq "" or $param eq "void"))
|
||||||
{
|
{
|
||||||
|
@ -1477,7 +1477,11 @@ sub push_parameter($$$) {
|
||||||
$param="void";
|
$param="void";
|
||||||
$parameterdescs{void} = "no arguments";
|
$parameterdescs{void} = "no arguments";
|
||||||
}
|
}
|
||||||
if (defined $type && $type && !defined $parameterdescs{$param_name}) {
|
# warn if parameter has no description
|
||||||
|
# (but ignore ones starting with # as these are no parameters
|
||||||
|
# but inline preprocessor statements
|
||||||
|
if (!defined $parameterdescs{$param_name} && $param_name !~ /^#/) {
|
||||||
|
|
||||||
$parameterdescs{$param_name} = $undescribed;
|
$parameterdescs{$param_name} = $undescribed;
|
||||||
|
|
||||||
if (($type eq 'function') || ($type eq 'enum')) {
|
if (($type eq 'function') || ($type eq 'enum')) {
|
||||||
|
|
Loading…
Reference in a new issue