aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-11-19 10:50:14 +0100
committerRichard Levitte <levitte@openssl.org>2019-11-29 20:55:16 +0100
commit31d3a7590274b48b194ed070ae531238764647f9 (patch)
tree77c8d0b3d769bfdb748e6695216f1949d32f9bea /util
parentc48e2d106b8740f817b099310fb084375b743196 (diff)
downloadopenssl-31d3a7590274b48b194ed070ae531238764647f9.zip
openssl-31d3a7590274b48b194ed070ae531238764647f9.tar.gz
openssl-31d3a7590274b48b194ed070ae531238764647f9.tar.bz2
util/find-doc-nits: limit the prototype check
The prototype checks shouldn't be performed on SYNOPSIS lines that aren't function prototypes. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10394)
Diffstat (limited to 'util')
-rwxr-xr-xutil/find-doc-nits5
1 files changed, 4 insertions, 1 deletions
diff --git a/util/find-doc-nits b/util/find-doc-nits
index da6e49f..acd9aa4 100755
--- a/util/find-doc-nits
+++ b/util/find-doc-nits
@@ -140,6 +140,7 @@ sub name_synopsis {
foreach my $line ( split /\n+/, $syn ) {
next unless $line =~ /^\s/;
my $sym;
+ my $is_prototype = 1;
$line =~ s/STACK_OF\([^)]+\)/int/g;
$line =~ s/SPARSE_ARRAY_OF\([^)]+\)/int/g;
$line =~ s/__declspec\([^)]+\)//;
@@ -154,11 +155,13 @@ sub name_synopsis {
$sym = $1;
} elsif ( $line =~ /typedef.* (\S+);/ ) {
# a simple typedef: typedef ... NAME;
+ $is_prototype = 0;
$sym = $1;
} elsif ( $line =~ /enum (\S*) \{/ ) {
# an enumeration: enum ... {
$sym = $1;
} elsif ( $line =~ /#(?:define|undef) ([A-Za-z0-9_]+)/ ) {
+ $is_prototype = 0;
$sym = $1;
} elsif ( $line =~ /([A-Za-z0-9_]+)\(/ ) {
$sym = $1;
@@ -172,7 +175,7 @@ sub name_synopsis {
# Do some sanity checks on the prototype.
err($id, "prototype missing spaces around commas: $line")
- if ( $line =~ /[a-z0-9],[^ ]/ );
+ if $is_prototype && $line =~ /[a-z0-9],[^ ]/;
}
foreach my $n ( keys %names ) {