Bug 233040 - Some C++ source files use #pragma once
Summary: Some C++ source files use #pragma once
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adrian Perez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-11-12 06:08 PST by Adrian Perez
Modified: 2021-11-14 14:39 PST (History)
8 users (show)

See Also:


Attachments
Patch (5.93 KB, patch)
2021-11-12 06:11 PST, Adrian Perez
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Perez 2021-11-12 06:08:52 PST
Given that “#pragma once” is intended to be used only in headers (or, more
precisely, in files that get “#include”'d), it does not make sense to make
use of it inside implementation .cpp files, yet it is present in a few:

  % rg --files-with-matches --glob '*.cpp' '^#pragma once' Source/ 
  Source/WebKit/WebProcess/WebCoreSupport/WebCaptionPreferencesDelegate.cpp
  Source/WebCore/Modules/WebGPU/GPURenderPassEncoder.cpp
  Source/WebCore/Modules/WebGPU/GPURenderBundleEncoder.cpp
  Source/WebCore/Modules/WebGPU/GPUQueue.cpp
  Source/WebCore/Modules/WebGPU/GPUQuerySet.cpp
  Source/WebCore/Modules/WebGPU/GPUComputePassEncoder.cpp
  Source/WebCore/Modules/WebGPU/GPUCommandEncoder.cpp
  Source/WebCore/Modules/WebGPU/GPUBuffer.cpp
  Source/WebCore/page/PerformanceNavigationTiming.cpp
  %

At least GCC 11.1 will warn about these spurious uses.
Comment 1 Adrian Perez 2021-11-12 06:11:56 PST
Created attachment 444061 [details]
Patch
Comment 2 Adrian Perez 2021-11-12 08:28:39 PST
Thanks cdumez! The build failure from the mac-wk1 is unrelated, that
queue seems to be having trouble lately, so I'll go ahead and mark
this cq+ :)
Comment 3 Chris Dumez 2021-11-12 08:30:52 PST
(In reply to Adrian Perez from comment #2)
> Thanks cdumez! The build failure from the mac-wk1 is unrelated, that
> queue seems to be having trouble lately, so I'll go ahead and mark
> this cq+ :)

Yes, I filed https://bugs.webkit.org/show_bug.cgi?id=233043 and skipped that test due to all these ews mac-wk1 false positives.
Comment 4 EWS 2021-11-12 08:39:56 PST
Committed r285724 (244183@main): <https://commits.webkit.org/244183@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 444061 [details].
Comment 5 Radar WebKit Bug Importer 2021-11-12 08:40:24 PST
<rdar://problem/85344690>
Comment 6 Myles C. Maxfield 2021-11-12 11:01:17 PST
Thanks for fixing this!!!
Comment 7 Adrian Perez 2021-11-14 14:39:55 PST
(In reply to Myles C. Maxfield from comment #6)
> Thanks for fixing this!!!

No problem at all :)