WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
25864
strict aliasing issues in WebCore/page/SecurityOriginHash.h
https://bugs.webkit.org/show_bug.cgi?id=25864
Summary
strict aliasing issues in WebCore/page/SecurityOriginHash.h
Craig Schlenter
Reported
2009-05-19 09:10:08 PDT
I've been compiling chromium with gcc 4.4 and I've had to use -fno-strict-aliasing for webkit due to a couple of issues. The code in question should be equivalent to that in WebKit itself. Here's one of the issues: In file included from /home/craig/chromium.git/src/third_party/WebKit/WebCore/storage/OriginQuotaManager.h:35, from /home/craig/chromium.git/src/third_party/WebKit/WebCore/storage/DatabaseTracker.cpp:40: /home/craig/chromium.git/src/third_party/WebKit/WebCore/platform/text/StringImpl.h: In static member function 'static unsigned int WebCore::SecurityOriginHash::hash(WebCore::SecurityOrigin*)': /home/craig/chromium.git/src/third_party/WebKit/WebCore/platform/text/StringImpl.h:210: warning: dereferencing pointer 'data' does break strict-aliasing rules /home/craig/chromium.git/src/third_party/WebKit/WebCore/page/SecurityOriginHash.h:46: note: initialized from here /home/craig/chromium.git/src/third_party/WebKit/WebCore/platform/text/StringImpl.h:213: note: initialized from here /home/craig/chromium.git/src/third_party/WebKit/WebCore/platform/text/StringImpl.h:211: warning: dereferencing pointer '<anonymous>' does break strict-aliasing rules /home/craig/chromium.git/src/third_party/WebKit/WebCore/platform/text/StringImpl.h:211: note: initialized from here I'm attaching a patch which seems to work for me but I have only tested it on linux ... I don't know how other compilers will deal with the union initialisation etc. etc.
Attachments
attempted fix for strict aliasing issue
(1.65 KB, patch)
2009-05-19 09:12 PDT
,
Craig Schlenter
eric
: review-
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Craig Schlenter
Comment 1
2009-05-19 09:12:43 PDT
Created
attachment 30472
[details]
attempted fix for strict aliasing issue only tested on linux with gcc 4.4 in chromium
Darin Adler
Comment 2
2009-05-19 09:30:18 PDT
Comment on
attachment 30472
[details]
attempted fix for strict aliasing issue In the past, WebCore has not been compiled with strict aliasing turned on. Unlike JavaScriptCore, where we fixed all the strict aliasing issues. I would expect many, many problems in WebCore. Not just warnings, but actual code generation problems. Do we really want to do this project (turning on strict aliasing in WebCore)?
Evan Martin
Comment 3
2009-05-19 10:06:44 PDT
I take Darin's comment to mean that in the interim, we should turn off strict aliasing in Chrome for now.
Peter Kasting
Comment 4
2009-05-19 11:06:27 PDT
Over time we should definitely fix strict aliasing problems. GCC is not the only compiler where they can cause issues. Generally they are easy to fix by adding unions (I would probably elect to use more typedefs in the particular patch above for clarity, though).
Eric Seidel (no email)
Comment 5
2009-05-19 22:45:08 PDT
Comment on
attachment 30472
[details]
attempted fix for strict aliasing issue
bug 16317
is another way to make this code cleaner. But given the above comments, I think we should close this and someone who is interested in turning on strict aliasing warnings for WebCore can do this for real later.
Eric Seidel (no email)
Comment 6
2009-05-19 22:45:42 PDT
WONTFIX based on the above comments. Feel free to open a more general bug about turning on strict aliasing in WebCore.
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