Bug 45301

Summary: Fix increases required alignment of target type warnings on ARM
Product: WebKit Reporter: Csaba Osztrogonác <ossy>
Component: New BugsAssignee: Gabor Loki <loki>
Status: RESOLVED FIXED    
Severity: Minor CC: commit-queue, loki, yong.li.webkit
Priority: P3    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: Linux   
Bug Depends on:    
Bug Blocks: 43191    
Attachments:
Description Flags
Fix increases required alignment of target type warning on ARM none

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