Summary: | Fix -Wcast-align warning in WebBasePluginPackage.mm | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | David Kilzer (:ddkilzer) <ddkilzer> | ||||||
Component: | WebKit Misc. | Assignee: | David Kilzer (:ddkilzer) <ddkilzer> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | andersca, darin, webkit.review.bot, zwarich | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Other | ||||||||
OS: | OS X 10.5 | ||||||||
Attachments: |
|
Attachment 88891 [details] did not pass style-queue:
Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit/mac/ChangeLog', u'Source/Web..." exit_code: 1
Source/WebKit/mac/ChangeLog:1: ChangeLog entry has no bug number [changelog/bugnumber] [5]
Total errors found: 1 in 2 files
If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 88891 [details]
Patch
Cameron pointed out that my pointer math is incorrect. New patch forthcoming.
Created attachment 88907 [details]
Patch v2
Committed r83755: <http://trac.webkit.org/changeset/83755> |
Created attachment 88891 [details] Patch 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(-)