[webkit-reviews] review requested: [Bug 58172] Fix -Wcast-align warning in WebBasePluginPackage.mm : [Attachment 88891] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Apr 8 16:10:58 PDT 2011


David Kilzer (ddkilzer) <ddkilzer at webkit.org> has asked  for review:
Bug 58172: Fix -Wcast-align warning in WebBasePluginPackage.mm
https://bugs.webkit.org/show_bug.cgi?id=58172

Attachment 88891: Patch
https://bugs.webkit.org/attachment.cgi?id=88891&action=review

------- Additional Comments from David Kilzer (ddkilzer) <ddkilzer at webkit.org>
Reviewed by NOBODY (OOPS!).

Fixes the following warning with -Wcast-align enabled:

Source/WebKit/mac/Plugins/WebBasePluginPackage.mm:402:21:{402:21-402:93}{402:39
-402:93}: error: cast from 'uint8_t *' (aka 'unsigned char *') to 'struct
fat_arch *' increases required alignment from 1 to 4 [-Werror,-Wcast-align,3]
archs = (struct fat_arch*)((uint8_t*)rawData.data() + sizeof(struct
fat_header));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* Plugins/WebBasePluginPackage.mm:
(-[WebBasePluginPackage isNativeLibraryData:]): Remove cast to
(uint8_t*).  The rawData Vector uses a type of uint32_t, and
struct fat_header contains two uint32_t data members, so there
is no need to cast to uint8_t* here.
---
 2 files changed, 19 insertions(+), 1 deletions(-)


More information about the webkit-reviews mailing list