Summary: | Fix cast-align warning in StringImpl.h | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Csaba Osztrogonác <ossy> | ||||
Component: | New Bugs | Assignee: | Csaba Osztrogonác <ossy> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | andersca, benjamin, cmarcelo, commit-queue, kling, ossy | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Csaba Osztrogonác
2014-12-03 07:14:55 PST
warning log on ARM Linux build: ../../Source/WTF/wtf/text/StringImpl.h: In instantiation of ‘T* WTF::StringImpl::tailPointer() [with T = short unsigned int]’: ../../Source/WTF/wtf/text/StringImpl.h:182:39: required from here ../../Source/WTF/wtf/text/StringImpl.h:749:87: warning: cast from ‘uint8_t* {aka unsigned char*}’ to ‘short unsigned int*’ increases required alignment of target type [-Wcast-align] return reinterpret_cast_ptr<T*>(reinterpret_cast<uint8_t*>(this) + tailOffset<T>()); ^ ../../Source/WTF/wtf/text/StringImpl.h: In instantiation of ‘const T* WTF::StringImpl::tailPointer() const [with T = short unsigned int]’: ../../Source/WTF/wtf/text/StringImpl.h:720:47: required from here ../../Source/WTF/wtf/text/StringImpl.h:743:99: warning: cast from ‘const uint8_t* {aka const unsigned char*}’ to ‘const short unsigned int*’ increases required alignment of target type [-Wcast-align] return reinterpret_cast_ptr<const T*>(reinterpret_cast<const uint8_t*>(this) + tailOffset<T>()); ^ ../../Source/WTF/wtf/text/StringImpl.h: In instantiation of ‘const T* WTF::StringImpl::tailPointer() const [with T = WTF::StringImpl*]’: ../../Source/WTF/wtf/text/StringImpl.h:756:42: required from here ../../Source/WTF/wtf/text/StringImpl.h:743:99: warning: cast from ‘const uint8_t* {aka const unsigned char*}’ to ‘WTF::StringImpl* const*’ increases required alignment of target type [-Wcast-align] ../../Source/WTF/wtf/text/StringImpl.h: In instantiation of ‘T* WTF::StringImpl::tailPointer() [with T = WTF::StringImpl*]’: ../../Source/WTF/wtf/text/StringImpl.h:763:42: required from here ../../Source/WTF/wtf/text/StringImpl.h:749:87: warning: cast from ‘uint8_t* {aka unsigned char*}’ to ‘WTF::StringImpl**’ increases required alignment of target type [-Wcast-align] return reinterpret_cast_ptr<T*>(reinterpret_cast<uint8_t*>(this) + tailOffset<T>()); ^ These casts are safe, tailOffset guarantees the alignment. cc-ing Anders and Andreas, because https://trac.webkit.org/changeset/163341 touched these lines last time. Created attachment 242490 [details]
Patch
Comment on attachment 242490 [details] Patch Clearing flags on attachment: 242490 Committed r176805: <http://trac.webkit.org/changeset/176805> All reviewed patches have been landed. Closing bug. |