Closed
Bug 1247505
Opened 10 years ago
Closed 10 years ago
woff2 build failure: invalid cast from type ‘int’ to type ‘uint16_t
Categories
(Core :: Graphics: Text, defect)
Core
Graphics: Text
Tracking
()
RESOLVED
FIXED
mozilla47
| Tracking | Status | |
|---|---|---|
| firefox47 | --- | fixed |
People
(Reporter: stevensn, Assigned: stevensn)
References
Details
(Whiteboard: gfx-noted)
Attachments
(1 file)
|
1.78 KB,
patch
|
fwang
:
review+
|
Details | Diff | Splinter Review |
Build error on my ppc64 machine from woff2
/modules/woff2/Unified_cpp_modules_woff20.cpp:29:
/media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/modules/woff2/src/./store_bytes.h: In function ‘size_t woff2::Store16(uint8_t*, size_t, int)’:
/media/nfs/usb_drive_src/firefox/mozilla-central-hg/src/modules/woff2/src/./store_bytes.h:40:76: error: invalid cast from type ‘int’ to type ‘uint16_t {aka short unsigned int}’
*reinterpret_cast<uint16_t*>(dst + offset) = reinterpret_cast<uint16_t>(x);
Filed upstream issue at https://github.com/google/woff2/issues/44
Updated•10 years ago
|
Whiteboard: gfx-noted
| Assignee | ||
Comment 1•10 years ago
|
||
Upstream pull request https://github.com/google/woff2/pull/45
Attachment #8719188 -
Flags: review?(fred.wang)
| Assignee | ||
Updated•10 years ago
|
Assignee: nobody → steve
Status: NEW → ASSIGNED
Comment 2•10 years ago
|
||
A lhs pointer cast and dereference always makes me a bit nervous - are we sure the target address is properly aligned? If not, the third ifdef alternative would be preferable (or needed at least on strict alignment platforms)
| Assignee | ||
Comment 3•10 years ago
|
||
Martin, would it be better to write the middle block as
uint16_t * dst_16 = reinterpret_cast<uint16_t*>(dst);
dst_16[offset] = static_cast<uint16_t>(x) | static_cast<uint16_t>(x>>8);
Does the first LITTLE_ENDIAN case need adjusting as well?
Comment 4•10 years ago
|
||
The question is weather we do know for sure that both dst and offset are properly aligned. If we do, all is fine. If not, both cases would need adjustment for some CPUs.
Is there an easy way to exercise this code?
However, all this is a separate issue, the compile issue you raised should be fixed, it breaks my build as well (and this discussion maybe should happen upstream)
Comment 5•10 years ago
|
||
Comment on attachment 8719188 [details] [diff] [review]
Fix woff2 compile error on big endian
Review of attachment 8719188 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks. Let's just take this patch now that it is merged upstream.
Attachment #8719188 -
Flags: review?(fred.wang) → review+
| Assignee | ||
Comment 6•10 years ago
|
||
Keywords: checkin-needed
Keywords: checkin-needed
Comment 8•10 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox47:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in
before you can comment on or make changes to this bug.
Description
•