Closed
Bug 986794
Opened 11 years ago
Closed 11 years ago
Suppress clang warnings in third-party code: libopus and libtheora
Categories
(Core :: Audio/Video, defect)
Tracking
()
RESOLVED
FIXED
mozilla31
People
(Reporter: cpeterson, Assigned: cpeterson)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
1.34 KB,
patch
|
derf
:
review+
|
Details | Diff | Splinter Review |
clang reports the following warnings in a --disable-optimize build for OS X:
The libtheora code has a comment saying, "It's better to live with the spurious warnings."
media/libopus/celt/pitch.c:262:4 [-Wdeclaration-after-statement] ISO C90 forbids mixed declarations and code
media/libopus/src/opus_decoder.c:37:10 [-W#pragma-messages] You appear to be compiling without optimization, if so opus will be very slow.
media/libtheora/lib/state.c:717:4 [-Wtype-limits] comparison of unsigned expression < 0 is always false
media/libtheora/lib/state.c:718:4 [-Wtype-limits] comparison of unsigned expression < 0 is always false
Attachment #8395179 -
Flags: review?(tterribe)
Comment 1•11 years ago
|
||
Comment on attachment 8395179 [details] [diff] [review]
suppress-libopus-libtheora-warnings.patch
Review of attachment 8395179 [details] [diff] [review]:
-----------------------------------------------------------------
> media/libopus/celt/pitch.c:262:4 [-Wdeclaration-after-statement] ISO C90 forbids mixed declarations and code
This one was fixed upstream in January, FWIW.
::: media/libopus/moz.build
@@ +70,5 @@
> +
> +# Suppress warnings in third-party code.
> +if CONFIG['GNU_CC']:
> + CFLAGS += ['-Wno-declaration-after-statement']
> + if CONFIG['CLANG_CXX']:
Is CLANG_CXX really a proper subset of GNU_CC? That seems moderately crazy.
Attachment #8395179 -
Flags: review?(tterribe) → review+
Assignee | ||
Comment 2•11 years ago
|
||
(In reply to Timothy B. Terriberry (:derf) from comment #1)
> > +# Suppress warnings in third-party code.
> > +if CONFIG['GNU_CC']:
> > + CFLAGS += ['-Wno-declaration-after-statement']
> > + if CONFIG['CLANG_CXX']:
>
> Is CLANG_CXX really a proper subset of GNU_CC? That seems moderately crazy.
Proper subset in what way? The flags or the CXX/CC suffix? The CLANG_CC macro is defined in some mach files, but only CLANG_CXX is defined in moz.build files. (See bug 981507.) Both GNU_CC and GNU_CXX are defined moz.build files.
clang does not understand all gcc -W flags, but it does understand -Wno-declaration-after-statement. In another patch from my "suppress clang and gcc warnings in third-party code" series, I had to `if not CONFIG['CLANG_CXX'] then pass clang-incompatible gcc flags`.
Comment 3•11 years ago
|
||
> Proper subset in what way?
I meant that CLANG_CXX is set only if GNU_CC is set.
Assignee | ||
Comment 4•11 years ago
|
||
(In reply to Timothy B. Terriberry (:derf) from comment #3)
> > Proper subset in what way?
>
> I meant that CLANG_CXX is set only if GNU_CC is set.
clang pretends to be gcc in many cases, including defining preprocessor macros like __GNUC__ and this affects our moz.build macros. We have to check !clang for gcc-specific features, e.g. https://hg.mozilla.org/mozilla-central/file/c69c55582faa/mfbt/Compiler.h#l12
Assignee | ||
Comment 5•11 years ago
|
||
status-firefox30:
--- → wontfix
status-firefox31:
--- → fixed
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in
before you can comment on or make changes to this bug.
Description
•