WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
57241
check-webkit-style: "using namespace foo;" should be flagged as an error in headers
https://bugs.webkit.org/show_bug.cgi?id=57241
Summary
check-webkit-style: "using namespace foo;" should be flagged as an error in h...
David Kilzer (:ddkilzer)
Reported
2011-03-28 09:38:45 PDT
In
Bug 57239
, a "using namespace WebCore;" statement caused issues when compiling WebCore on iOS (even though the body of HTMLConverter.mm was commented out). Such "using namespace" statements are very dangerous in headers, so check-webkit-style should flag them as an error. I'm told that llvm (clang) may warn about "using namespace" statements in headers in the future, but since not all ports will be using llvm to compile WebKit, it would still be good to have this in check-webkit-style.
Attachments
Patch
(4.14 KB, patch)
2013-07-16 04:38 PDT
,
Brian Holt
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
David Levin
Comment 1
2011-03-29 10:22:19 PDT
fwiw, the code is here:
http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py
And I'm willing to give pointers (and reviews) to anyone who wants to add checks.
Brian Holt
Comment 2
2013-07-16 04:38:50 PDT
Created
attachment 206762
[details]
Patch
WebKit Commit Bot
Comment 3
2013-07-16 06:04:23 PDT
Comment on
attachment 206762
[details]
Patch Clearing flags on attachment: 206762 Committed
r152719
: <
http://trac.webkit.org/changeset/152719
>
WebKit Commit Bot
Comment 4
2013-07-16 06:04:28 PDT
All reviewed patches have been landed. Closing bug.
Kwang Yul Seo
Comment 5
2013-07-16 16:28:44 PDT
This patch is buggy. It seems check-webkit-style checks "using namespace" statements not only in headers but also in cpp files too. See
https://bugs.webkit.org/show_bug.cgi?id=110136#c14
Source/WebKit2/NetworkProcess/unix/NetworkProcessMainUnix.cpp:45: Do not use 'using namespace WebCore;'. [build/using_namespace] [4]
Kwang Yul Seo
Comment 6
2013-07-16 16:51:47 PDT
(In reply to
comment #5
)
> This patch is buggy. It seems check-webkit-style checks "using namespace" statements not only in headers but also in cpp files too. > > See
https://bugs.webkit.org/show_bug.cgi?id=110136#c14
> Source/WebKit2/NetworkProcess/unix/NetworkProcessMainUnix.cpp:45: Do not use 'using namespace WebCore;'. [build/using_namespace] [4]
I filed
Bug 118755
to fix this.
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