diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-10-02 10:58:52 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-10-02 16:35:53 +0200 |
commit | 26a7d51c21bce00e332bbd10443594edb879a871 (patch) | |
tree | d10c7901ebd1a7133f66bbd4e5a49e1120b1b6af /lib/checksrc.pl | |
parent | ddecd28268b78ae3361bc010c719446d55a8f894 (diff) | |
download | curl-26a7d51c21bce00e332bbd10443594edb879a871.tar.gz |
checksrc: warn on space after exclamation mark
Closes #6034
Diffstat (limited to 'lib/checksrc.pl')
-rwxr-xr-x | lib/checksrc.pl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/checksrc.pl b/lib/checksrc.pl index c47aaf0f5..f9d076a2f 100755 --- a/lib/checksrc.pl +++ b/lib/checksrc.pl @@ -84,6 +84,7 @@ my %warnings = ( 'TYPEDEFSTRUCT' => 'typedefed struct', 'DOBRACE' => 'A single space between do and open brace', 'BRACEWHILE' => 'A single space between open brace and while', + 'EXCLAMATIONSPACE' => 'Whitespace after exclamation mark in expression', ); sub readskiplist { @@ -725,6 +726,12 @@ sub scanfile { "typedef'ed struct"); } + if($nostr =~ /(.*)! +(\w|\()/) { + checkwarn("EXCLAMATIONSPACE", + $line, length($1)+1, $file, $ol, + "space after exclamation mark"); + } + # check for more than one consecutive space before open brace or # question mark. Skip lines containing strings since they make it hard # due to artificially getting multiple spaces |