History

kernel-doc: handle varargs cleanly

The method for listing varargs in kernel-doc notation is: * @...: these arguments are printed by the @fmt argument but scripts/kernel-doc is confused: it always lists varargs as: ... variable arguments and ignores the @...: line's description, but then prints that line after the list of function parameters as though it's not part of the function parameters. This patch makes kernel-doc print the supplied @... description if it is present; otherwise a boilerplate "variable arguments" is printed.

Randy Dunlap committed 17 years ago

Commit ced69091 parent 6ff2d391 file · +7 −3Browse files

Showing the changes to scripts/kernel-doc (1 of 1 file). Show all

Unified · Split

scripts/kernel-doc+7−3
@@ -378,6 +378,10 @@ sub dump_section { · 377 unmodified lines
378378 # print STDERR "parameter def '$1' = '$contents'\n";
379379 $name = $1;
380380 $parameterdescs{$name} = $contents;
381+ } elsif ($name eq "@\.\.\.") {
382+# print STDERR "parameter def '...' = '$contents'\n";
383+ $name = "...";
384+ $parameterdescs{$name} = $contents;
381385 } else {
382386 # print STDERR "other section '$name' = '$contents'\n";
383387 if (defined($sections{$name}) && ($sections{$name} ne "")) {
@@ -1588,12 +1592,12 @@ sub push_parameter($$$) { · 1204 unmodified lines
15881592
15891593 if ($type eq "" && $param =~ /\.\.\.$/)
15901594 {
1591− $type="";
1592− $parameterdescs{$param} = "variable arguments";
1595+ if (!defined $parameterdescs{$param} || $parameterdescs{$param} eq "") {
1596+ $parameterdescs{$param} = "variable arguments";
1597+ }
15931598 }
15941599 elsif ($type eq "" && ($param eq "" or $param eq "void"))
15951600 {
1596− $type="";
15971601 $param="void";
15981602 $parameterdescs{void} = "no arguments";
15991603 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t