[Webkit-unassigned] [Bug 51695] check-webkit-style treated some macros with parentheses after #elif as function calls

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Dec 31 09:05:58 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=51695





--- Comment #2 from David Levin <levin at chromium.org>  2010-12-31 09:05:58 PST ---
(In reply to comment #1)
> a stupid hack like this will avoid the issue, but this doesn't really look right
> 
> 
> Index: Tools/Scripts/webkitpy/style/checkers/cpp.py
> ===================================================================
> --- Tools/Scripts/webkitpy/style/checkers/cpp.py    (revision 74733)
> +++ Tools/Scripts/webkitpy/style/checkers/cpp.py    (working copy)
> @@ -1327,6 +1327,8 @@
>      # they'll never need to wrap.
>      if (  # Ignore control structures.
>          not search(r'\b(if|for|foreach|while|switch|return|new|delete)\b', function_call)
> +        # Ignore (()) right after '#elif '.
> +        and not search(r'\A#elif', function_call)
>          # Ignore pointers/references to functions.
>          and not search(r' \([^)]+\)\([^)]*(\)|,$)', function_call)
>          # Ignore pointers/references to arrays.

I  think you could simply change line 1341 to
1341                and not match(r'\s*(#|typedef)', function_call)):

Which will allow match any preprocessor directive or a typedef. (I switch from search to match because match only matches from the beginning of the line, which is why I added the \s*.)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list