Closed
Bug 1033192
Opened 10 years ago
Closed 10 years ago
Fix gcc -Wpointer-arith warnings and MSVC macro redefinition warnings in media/libcubeb
Categories
(Core :: General, defect)
Core
General
Tracking
()
RESOLVED
FIXED
mozilla33
People
(Reporter: cpeterson, Assigned: cpeterson)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
3.08 KB,
patch
|
padenot
:
review+
|
Details | Diff | Splinter Review |
I made struct cubeb_stream's queuebuf an array of pointers to bytes (uint8_t) instead of void to workaround the gcc warning about doing pointer math that assumes sizeof(void) == 1. Alternatively, we could keep queuebuf as an array of pointers to void, I can add a (uint_t*) cast to the memset().
Also #undef some redefined Windows macros and mark media/libcubeb as FAIL_ON_WARNINGS (because, in bug 986793 comment 1, you said cubeb is not really third-party code).
media/libcubeb/src/cubeb_opensl.c:122:16 [-Wpointer-arith] pointer of type 'void *' used in arithmetic
c:/builds/moz2_slave/m-cen-w32-00000000000000000000/build/media/libcubeb/src/cubeb_winmm.c(9) : warning C4005: 'WINVER' : macro redefinition
c:\builds\moz2_slave\m-cen-w32-00000000000000000000\build\obj-firefox\media\libcubeb\src\../../../dist/include/mozilla-config.h(140) : see previous definition of 'WINVE
c:/builds/moz2_slave/m-cen-w32-00000000000000000000/build/media/libcubeb/src/cubeb_winmm.c(10) : warning C4005: 'WIN32_LEAN_AND_MEAN' : macro redefinition
c:\builds\moz2_slave\m-cen-w32-00000000000000000000\build\obj-firefox\media\libcubeb\src\../../../dist/include/mozilla-config.h(139) : see previous definition of 'WIN32
Attachment #8449216 -
Flags: review?(paul)
Comment 1•10 years ago
|
||
Comment on attachment 8449216 [details] [diff] [review]
fix-cubeb-warnings.patch
Review of attachment 8449216 [details] [diff] [review]:
-----------------------------------------------------------------
::: media/libcubeb/src/cubeb_opensl.c
@@ +570,5 @@
> }
>
> int i;
> for (i = 0; i < NBUFS; i++) {
> + stm->queuebuf[i] = (uint8_t*) malloc(stm->queuebuf_len);
Don't cast the return of malloc.
Attachment #8449216 -
Flags: review?(paul) → review+
Assignee | ||
Comment 2•10 years ago
|
||
status-firefox32:
--- → wontfix
status-firefox33:
--- → fixed
Assignee | ||
Comment 3•10 years ago
|
||
As you recommended in comment 1, I landed the patch without the malloc cast.
Comment 4•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
Comment 5•10 years ago
|
||
I can no longer build locally and suspect this bug is the cause. See bug 1034140.
You need to log in
before you can comment on or make changes to this bug.
Description
•