Skip to content

Commit 72bce21

Browse files
committed
autodoc: Preprocessor symbol has no arguments
When documenting something like DOINIT which is either #defined or not, it will never have an argument, so automatically include that without the user having to specify it.
1 parent 621b530 commit 72bce21

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

autodoc.pl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,7 @@ sub check_and_add_proto_defn {
572572

573573
$flags .= "m" if $flags =~ /M/;
574574
$flags .= "U" if $flags =~ /@/; # No usage output for @arrays
575+
$flags .= "n" if $flags =~ /#/; # No threads, arguments for #ifdef
575576

576577
my @munged_args= $args_ref->@*;
577578
s/\b(?:NN|NULLOK)\b\s+//g for @munged_args;
@@ -1858,9 +1859,9 @@ ($fh, $section_name, $element_name, $docref)
18581859

18591860
my $has_args = $flags !~ /n/;
18601861
if (! $has_args) {
1861-
warn "$name: n flag without m "
1862+
warn "$name: n flag without [m#] "
18621863
. where_from_string($item->{file}, $item->{line_num})
1863-
unless $flags =~ /m/;
1864+
unless $flags =~ /[m#]/;
18641865

18651866
if ($item->{args} && $item->{args}->@*) {
18661867
warn "$name: n flag but apparently has args"

0 commit comments

Comments
 (0)