Bug 193750

Summary: check-webkit-style should warn when using soft-linking macros in a header
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: Tools / TestsAssignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, ap, commit-queue, darin, ddkilzer, ews-watchlist, glenn, lforschler, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=193815
https://bugs.webkit.org/show_bug.cgi?id=193866
https://bugs.webkit.org/show_bug.cgi?id=193868
https://bugs.webkit.org/show_bug.cgi?id=193884
Attachments:
Description Flags
Patch v1 none

David Kilzer (:ddkilzer)
Reported 2019-01-23 16:56:17 PST
check-webkit-style should warn when using soft-linking macros in a header. Using the soft-linking macros in a header will lead to code being compiled in every translation unit (source file) that the header is included in, which is usually not what the author intends, and leads to duplicate code. Example output on pre-existing files: $ ./Tools/Scripts/check-webkit-style -f '-,+softlink/header' Source/WebCore/PAL ERROR: Source/WebCore/PAL/pal/spi/ios/DataDetectorsUISPI.h:65: Never soft-link frameworks in headers since this results in duplicate code in each source file where it is included. [softlink/header] [5] ERROR: Source/WebCore/PAL/pal/spi/mac/DataDetectorsSPI.h:109: Never soft-link frameworks in headers since this results in duplicate code in each source file where it is included. [softlink/header] [5] ERROR: Source/WebCore/PAL/pal/spi/mac/DataDetectorsSPI.h:110: Never soft-link frameworks in headers since this results in duplicate code in each source file where it is included. [softlink/header] [5] ERROR: Source/WebCore/PAL/pal/spi/mac/TUCallSPI.h:38: Never soft-link frameworks in headers since this results in duplicate code in each source file where it is included. [softlink/header] [5] ERROR: Source/WebCore/PAL/pal/spi/mac/LookupSPI.h:33: Never soft-link frameworks in headers since this results in duplicate code in each source file where it is included. [softlink/header] [5] ERROR: Source/WebCore/PAL/pal/spi/cocoa/NSAttributedStringSPI.h:34: Never soft-link frameworks in headers since this results in duplicate code in each source file where it is included. [softlink/header] [5] ERROR: Source/WebCore/PAL/pal/spi/cocoa/RevealSPI.h:32: Never soft-link frameworks in headers since this results in duplicate code in each source file where it is included. [softlink/header] [5] ERROR: Source/WebCore/PAL/pal/spi/cocoa/RevealSPI.h:33: Never soft-link frameworks in headers since this results in duplicate code in each source file where it is included. [softlink/header] [5] Total errors found: 8 in 176 files
Attachments
Patch v1 (8.23 KB, patch)
2019-01-23 17:40 PST, David Kilzer (:ddkilzer)
no flags
David Kilzer (:ddkilzer)
Comment 1 2019-01-23 17:40:33 PST
Created attachment 359977 [details] Patch v1
WebKit Commit Bot
Comment 2 2019-01-23 18:47:58 PST
Comment on attachment 359977 [details] Patch v1 Clearing flags on attachment: 359977 Committed r240402: <https://trac.webkit.org/changeset/240402>
WebKit Commit Bot
Comment 3 2019-01-23 18:48:00 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 4 2019-01-23 18:48:28 PST
Note You need to log in before you can comment on or make changes to this bug.