summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2012-10-11 13:22:29 -0400
committerGreg Hudson <ghudson@mit.edu>2012-10-11 13:22:29 -0400
commitdd25220d170f128f782758337f8e6b951adaee5f (patch)
treebf38e307852c74a0524672a3e2ead4b7f9aff96b /src/util
parenta9126e9f642b139a489e307c7b36d884d3904c17 (diff)
downloadkrb5-dd25220d170f128f782758337f8e6b951adaee5f.tar.gz
krb5-dd25220d170f128f782758337f8e6b951adaee5f.tar.xz
krb5-dd25220d170f128f782758337f8e6b951adaee5f.zip
Fix cast regexp in C style checker
In check_cast, we want to match cast operators with or without spaces after the closing paren, and then check for spaces after we match. Also, per the comment, we want to match potential cast operators followed by an open paren.
Diffstat (limited to 'src/util')
-rw-r--r--src/util/cstyle-file.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/cstyle-file.py b/src/util/cstyle-file.py
index edf8a39173..2295104220 100644
--- a/src/util/cstyle-file.py
+++ b/src/util/cstyle-file.py
@@ -141,7 +141,7 @@ def check_cast(line, ln):
# multiplication operator. We will get false positives from
# "(*fp) (args)" and "if (condition) statement", but both of those
# are erroneous anyway.
- for m in re.finditer(r'\(([^(]+)\)(\s+)[a-zA-Z_]', line):
+ for m in re.finditer(r'\(([^(]+)\)(\s*)[a-zA-Z_(]', line):
if m.group(2):
warn(ln, 'Space after cast operator (or inline if/while body)')
# Check for casts like (char*) which should have a space.