WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
163575
check-webkit-style: fix false-positive warnings about using #pragma once header guard
https://bugs.webkit.org/show_bug.cgi?id=163575
Summary
check-webkit-style: fix false-positive warnings about using #pragma once head...
Megan Gardner
Reported
2016-10-17 17:41:40 PDT
The style guide gave me false positives for errors in TestRunnerWKWebView.h and WKWebViewPrivate.h about the #pragma once header guards. Not needed because of obj-c #import.
Attachments
[PATCH] Proposed Fix
(3.06 KB, patch)
2016-10-19 11:04 PDT
,
Joseph Pecoraro
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Joseph Pecoraro
Comment 1
2016-10-18 16:57:06 PDT
Ooo good point... I wonder if we can tell if such a file will be ObjC/ObjC++. We could employ heuristics like "if there is an #import".
Brady Eidson
Comment 2
2016-10-19 09:16:45 PDT
I think the simple solution is to detect *if* there is a header guard, *then* it has to be pragma once. Headers without guards are clearly okay (as if they weren't okay then the builds would be failing)
Joseph Pecoraro
Comment 3
2016-10-19 11:04:30 PDT
> Headers without guards are clearly okay (as if they weren't okay then the > builds would be failing)
It would be nice to detect and warn when a header is missing header guards that _should_ have header guards. A build may succeed if its missing, but later when someone else double includes the header it could fail. That said, your suggestion should catch the majority of cases. Patch coming.
Joseph Pecoraro
Comment 4
2016-10-19 11:04:45 PDT
Created
attachment 292084
[details]
[PATCH] Proposed Fix
Brady Eidson
Comment 5
2016-10-19 12:28:27 PDT
(In reply to
comment #3
)
> > Headers without guards are clearly okay (as if they weren't okay then the > > builds would be failing) > > It would be nice to detect and warn when a header is missing header guards > that _should_ have header guards. A build may succeed if its missing, but > later when someone else double includes the header it could fail.
Yah, I guess that was the unspoken subtext of what I meant. I also am not sure what the actual compiler error is when you double include a header - Whether it's unintelligible random errors, or if the compiler explicitly points it out. In the later case, I think it'd be fine to just ignore it until an error pops up.
Brady Eidson
Comment 6
2016-10-19 12:29:16 PDT
Comment on
attachment 292084
[details]
[PATCH] Proposed Fix lgtm
WebKit Commit Bot
Comment 7
2016-10-19 12:53:23 PDT
Comment on
attachment 292084
[details]
[PATCH] Proposed Fix Clearing flags on attachment: 292084 Committed
r207559
: <
http://trac.webkit.org/changeset/207559
>
WebKit Commit Bot
Comment 8
2016-10-19 12:53:27 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug