Bug 45301 - Fix increases required alignment of target type warnings on ARM
Summary: Fix increases required alignment of target type warnings on ARM
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Linux
: P3 Minor
Assignee: Gabor Loki
URL:
Keywords:
Depends on:
Blocks: 43191
  Show dependency treegraph
 
Reported: 2010-09-07 09:16 PDT by Csaba Osztrogonác
Modified: 2010-10-13 08:51 PDT (History)
3 users (show)

See Also:


Attachments
Fix increases required alignment of target type warning on ARM (2.52 KB, patch)
2010-09-08 02:19 PDT, Gabor Loki
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Csaba Osztrogonác 2010-09-07 09:16:26 PDT
../../../WebCore/bindings/js/SerializedScriptValue.cpp:871: warning: cast from 'const uint8_t*' to 'const UChar*' increases required alignment of target type
../../../WebCore/bindings/js/SerializedScriptValue.cpp:783: warning: cast from 'const uint8_t*' to 'const uint32_t*' increases required alignment of target type
../../../WebCore/bindings/js/SerializedScriptValue.cpp:783: warning: cast from 'const uint8_t*' to 'const short unsigned int*' increases required alignment of target type
../../../WebCore/bindings/js/SerializedScriptValue.cpp:783: warning: cast from 'const uint8_t*' to 'const long long unsigned int*' increases required alignment of target type
../../../WebCore/plugins/PluginDatabase.cpp:510: warning: cast from 'char*' to 'time_t*' increases required alignment of target type


SerializedScriptValue.cpp:
---------------------------
static bool readString(const uint8_t*& ptr, const uint8_t* end, UString& str, unsigned length)
{
...
        str = UString(reinterpret_cast<const UChar*>(ptr), length); // <-- line 871
...
}


template <typename T> static bool readLittleEndian(const uint8_t*& ptr, const uint8_t* end, T& value)
{
...
            value = *reinterpret_cast<const T*>(ptr); // <-- line 783
...
}

PluginDatabase.cpp:
--------------------
static bool readTime(time_t& resultTime, char*& start, const char* end)
{
...
    resultTime = *reinterpret_cast<time_t*>(start); // <-- line 510
...
}
Comment 1 Gabor Loki 2010-09-08 02:19:56 PDT
Created attachment 66860 [details]
Fix increases required alignment of target type warning on ARM
Comment 2 Andreas Kling 2010-09-08 09:34:20 PDT
Comment on attachment 66860 [details]
Fix increases required alignment of target type warning on ARM

LGTM
Comment 3 WebKit Commit Bot 2010-09-08 15:44:01 PDT
Comment on attachment 66860 [details]
Fix increases required alignment of target type warning on ARM

Clearing flags on attachment: 66860

Committed r67028: <http://trac.webkit.org/changeset/67028>
Comment 4 WebKit Commit Bot 2010-09-08 15:44:05 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Yong Li 2010-10-13 08:51:01 PDT
Removing the warning doesn't fix the real problem: data in the buffer is not guaranteed to be aligned, so it can cause misaligned memory access on ARM (<v6). Bug 47594 is created for this