[Webkit-unassigned] [Bug 43963] Avoid increasing required alignment of target type warning

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 16 23:41:36 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=43963





--- Comment #8 from Gabor Loki <loki at webkit.org>  2010-08-16 23:41:35 PST ---
> The following patch will fix Vector buffer alignment warnings , which is done by casting m_inlineBuffer.buffer to static_cast<void*> 
> https://bug-38045-attachments.webkit.org/attachment.cgi?id=58134

Did you mean it removes the warnings on *MIPS* ? If so, you should use reinterpret_cast_ptr in the same way on MIPS as it is used on ARM. See the condition at http://trac.webkit.org/browser/trunk/JavaScriptCore/wtf/StdLibExtras.h?rev=65311#L64
Try using the following condition instead of the current one: #if COMPILER(GCC) && (CPU(ARM) || CPU(MIPS))
With this change the reinterpret_cast_ptr<T>(ptr) will be an implicit reinterpret_cast<T>(static_cast<void*>(ptr)) structure (done by the preprocessor).

> So my question can we use reinterpret_cast_ptr in place of reinterpret_cast, instead of casting it to static_cast<void*> ? If yes then which one is safe solution

You can use reinterpret_cast_ptr where these alignment warnings occur. Although you should make sure that the original code uses a proper allocation (aligned to the target type). If a reinterpret_cast_ptr is used and a target address is not aligned to the target type, an ASSERT will be called at that place in debug mode.

So, the reinterpret_cast_ptr does not solve any alignment warnings, just hides them in release mode. Although in debug mode an ASSERT will inform where the use of the original reinterpret_casts were bogus.

> I have ported 1.2.0 Gtk webkit release on both Arm and Mips ,But i get warnings only with Mips. And in Mips I also get alignment warnings at following lines.

I can take a look.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list