Bug 233040

Summary: Some C++ source files use #pragma once
Product: WebKit Reporter: Adrian Perez <aperez>
Component: Tools / TestsAssignee: Adrian Perez <aperez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, aperez, cdumez, clopez, dino, mcatanzaro, mmaxfield, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch ews-feeder: commit-queue-

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