From: Richard Levitte Date: Tue, 19 Nov 2019 09:50:14 +0000 (+0100) Subject: util/find-doc-nits: limit the prototype check X-Git-Tag: openssl-3.0.0-alpha1~872 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=31d3a7590274b48b194ed070ae531238764647f9;p=oweals%2Fopenssl.git 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 (Merged from https://github.com/openssl/openssl/pull/10394) --- diff --git a/util/find-doc-nits b/util/find-doc-nits index da6e49f781..acd9aa4e93 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 ) {