[27104] in CVS-changelog-for-Kerberos-V5

home help back first fref pref prev next nref lref last post

krb5 commit: Fix cast regexp in C style checker

daemon@ATHENA.MIT.EDU (Greg Hudson)
Thu Oct 11 13:24:43 2012

Date: Thu, 11 Oct 2012 13:24:41 -0400
From: Greg Hudson <ghudson@mit.edu>
Message-Id: <201210111724.q9BHOfFP020338@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu

https://github.com/krb5/krb5/commit/dd25220d170f128f782758337f8e6b951adaee5f
commit dd25220d170f128f782758337f8e6b951adaee5f
Author: Greg Hudson <ghudson@mit.edu>
Date:   Thu Oct 11 13:22:29 2012 -0400

    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.

 src/util/cstyle-file.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/util/cstyle-file.py b/src/util/cstyle-file.py
index edf8a39..2295104 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.
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5

home help back first fref pref prev next nref lref last post