Bug 161165 - check-webkit-style doesn't understand macros containing `else` or labels
Summary: check-webkit-style doesn't understand macros containing `else` or labels
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: JF Bastien
Depends on:
Reported: 2016-08-24 14:09 PDT by JF Bastien
Modified: 2016-08-29 12:38 PDT (History)
6 users (show)

See Also:

patch (2.67 KB, patch)
2016-08-25 12:25 PDT, JF Bastien
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-yosemite (991.30 KB, application/zip)
2016-08-25 13:18 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description JF Bastien 2016-08-24 14:09:33 PDT
In the following patch: https://bugs.webkit.org/show_bug.cgi?id=160921

check-webkit-style is unhappy with this idiom:

#FOO() \
  if (a) \
    stmt; \
  else \

As well as with labels:

#FOO() { \
  label: \
    stmt; \

In both cases, check-webkit-style's regular expressions don't expect a backslash there, making it sad.
Comment 1 JF Bastien 2016-08-24 14:23:02 PDT
Errors were:

ERROR: Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:1214:  Else clause should never be on same line as else (use 2 lines)  [whitespace/newline] [4]
ERROR: Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:1215:  Should be indented on a separate line, with the colon or comma first on that line.  [whitespace/indent]
Comment 2 JF Bastien 2016-08-25 12:25:58 PDT
Created attachment 286995 [details]

Fixed else in a macro. I don't think fixing labels in a macro is as useful (the checker thinks it's looking at initializer lists at that point, and its regexes are already complex).
Comment 3 Geoffrey Garen 2016-08-25 12:29:19 PDT
Comment on attachment 286995 [details]

Comment 4 Build Bot 2016-08-25 13:18:25 PDT
Comment on attachment 286995 [details]

Attachment 286995 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/1941456

New failing tests:
Comment 5 Build Bot 2016-08-25 13:18:28 PDT
Created attachment 287000 [details]
Archive of layout-test-results from ews101 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 6 JF Bastien 2016-08-25 13:24:37 PDT
Because I'm likely to forget: I ran the tests as follows
  PYTHONPATH=./Tools/Scripts/ python ./Tools/Scripts/webkitpy/test/main.py
Comment 7 WebKit Commit Bot 2016-08-29 12:38:29 PDT
Comment on attachment 286995 [details]

Clearing flags on attachment: 286995

Committed r205135: <http://trac.webkit.org/changeset/205135>
Comment 8 WebKit Commit Bot 2016-08-29 12:38:33 PDT
All reviewed patches have been landed.  Closing bug.