Bug 198349 - check-webkit-style reports false-positive build/include_order warning in WTF C++ source files
Summary: check-webkit-style reports false-positive build/include_order warning in WTF ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-05-29 13:23 PDT by David Kilzer (:ddkilzer)
Modified: 2019-05-29 15:06 PDT (History)
10 users (show)

See Also:


Attachments
Patch v1 (4.95 KB, patch)
2019-05-29 14:17 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2019-05-29 13:23:21 PDT
check-webkit-style reports false-positive build/include_order warning in WTF C++ source files.

For example, see Bug 198346 Comment #3:  <https://bugs.webkit.org/show_bug.cgi?id=198346#c3>

ERROR: Source/WTF/wtf/CrossThreadTaskHandler.cpp:29:  Alphabetical sorting problem.  [build/include_order] [4]

For this source in Source/WTF/wtf/CrossThreadTaskHandler.cpp:

    #include "config.h"
    #include <wtf/CrossThreadTaskHandler.h>
    
    #include <wtf/AutodrainedPool.h>

For whatever reason, most C++ source files in WTF use <wtf/Header.h> instead of "Header.h".
Comment 1 David Kilzer (:ddkilzer) 2019-05-29 14:16:13 PDT
This fix cuts down on a HUGE amount of false-positives about a missing primary header when running this command:

$ ./Tools/Scripts/check-webkit-style --filter=-,+build/include_order Source/WTF 2>&1 | grep -i primary
Comment 2 David Kilzer (:ddkilzer) 2019-05-29 14:17:18 PDT
Created attachment 370883 [details]
Patch v1
Comment 3 Alex Christensen 2019-05-29 14:37:52 PDT
Comment on attachment 370883 [details]
Patch v1

r=me
This is necessary so that #pragma once can work with WTF headers, which would otherwise sometimes be included from the build directory and sometimes from the source causing duplicate declarations from including two copies of the same header.
Comment 4 David Kilzer (:ddkilzer) 2019-05-29 14:39:00 PDT
(In reply to Alex Christensen from comment #3)
> Comment on attachment 370883 [details]
> Patch v1
> 
> r=me
> This is necessary so that #pragma once can work with WTF headers, which
> would otherwise sometimes be included from the build directory and sometimes
> from the source causing duplicate declarations from including two copies of
> the same header.

Thanks for the explanation!
Comment 5 WebKit Commit Bot 2019-05-29 15:05:06 PDT
Comment on attachment 370883 [details]
Patch v1

Clearing flags on attachment: 370883

Committed r245870: <https://trac.webkit.org/changeset/245870>
Comment 6 WebKit Commit Bot 2019-05-29 15:05:07 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2019-05-29 15:06:19 PDT
<rdar://problem/51238831>