[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
Sun Jan 2 19:33:20 PST 2011


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





--- Comment #4 from David Levin <levin at chromium.org>  2011-01-02 19:33:20 PST ---
(In reply to comment #3)
> (In reply to comment #2)
> > > Index: Tools/Scripts/webkitpy/style/checkers/cpp.py
> > > > 
> > 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*.)
> 
> it looks better than my stupid hack. Maybe I should mention that
>    #if (OS(LINUX) && PLATFORM(CHROMIUM)) || (OS(DARWIN) && !PLATFORM(CF))
> would not run into #elif problem, so I think maybe there is a way to avoid calling check_spacing_for_function_call

The reason that "#if" doesn't trigger the warning is just plain luck. The line
         not search(r'\b(if|for|foreach|while|switch|return|new|delete)\b', function_call)
excludes it but it is thereto detect the "if" statement. It just also happens to work for the #if preprocessor directive.

-- 
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