Skip to content

Commit

Permalink
Merge branch 'hotfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Gautier committed Nov 26, 2016
2 parents bcc0a07 + 2c55d79 commit 020863a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
11 changes: 8 additions & 3 deletions betty-doc.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2831,23 +2831,28 @@ ($)
$_ .= <IN>;
}

if ($_ =~ /^(?:typedef\s+)?(?:(?:$Storage|$Inline)\s*)*\s*$Type\s*\(?\**($Ident)\s*\(/s &&
my $attr = qr{__attribute__\s*\(\(\w+\)\)};

if ($_ =~ /^(?:typedef\s+)?(?:(?:$Storage|$Inline)\s*)*\s*$Type\s*(?:$attr\s*)?\(?\**($Ident)\s*\(/s &&
$_ !~ /;\s*$/)
{
# print STDOUT "Function found: $1\n";
if (!length $identifier || $identifier ne $1) {
print STDERR "${file}:$.: warning: no description found for function $1\n";
++$warnings;
}
elsif ($_ =~ /^(?:(?:$Storage|$Inline)\s*)*\s*($Type)\s*\(\**($Ident)\s*\((.*)\)\)\s*\(/s)
{
elsif ($_ =~ /^(?:(?:$Storage|$Inline)\s*)*\s*($Type)\s*\(\**($Ident)\s*\((.*)\)\)\s*\(/s) {
my $type_ = $1;
my $func_ = $2;
my $params_ = $3;
$_ = "${type_} *${func_} (${params_})\n";
# print "LINE:$_\n";
# print "FUNCTION -> ${type_} ${func_} (${params_})\n";
}
elsif ($_ =~ $attr) {
$_ =~ s/__attribute__\s*\(\(\w+\)\)//;
# print "LINE:$_\n";
}
}

if ($_ =~ /^\s*(?:typedef\s+)?(enum|union|struct)(?:\s+($Ident))?\s*.*/s &&
Expand Down
23 changes: 23 additions & 0 deletions tests/doc/doc10.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* first - Called before main
*/
void __attribute__((constructor)) first(void)
{
printf("test\n");
}

/**
* first - Called before main
*/
void __attribute__ ((constructor)) first(void)
{
printf("test\n");
}

/**
* first - Called before main
*/
void __attribute__((constructor))first(void)
{
printf("test\n");
}
Empty file added tests/doc/doc10.expected.stderr
Empty file.
3 changes: 3 additions & 0 deletions tests/doc/doc10.expected.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
first
first
first

0 comments on commit 020863a

Please sign in to comment.