Closed Bug 878363 Opened 11 years ago Closed 11 years ago

GStreamer builds failing due to -Wreserved-user-defined-literal in gst/video/video.h

Categories

(Core :: Audio/Video, defect)

All
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: johns, Assigned: johns)

References

Details

Attachments

(3 files, 2 obsolete files)

gst/video/video.h fails in compilation recently with:

 0:05.33 In file included from ../../dist/include/GStreamerReader.h:11:
 0:05.33 /usr/include/gstreamer-0.10/gst/video/video.h:345:17: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
 0:05.33       "width = "GST_VIDEO_SIZE_RANGE" , "                               \

This occurs on revisions I've built successfully before, so this is likely due to a new gstreamer 0.10 version.
Comment on attachment 756882 [details] [diff] [review]
Disable -Wreserved-user-defined-literal for problematic gstreamer header

@Ted, I'm not sure what the usual approach is for dealing with warnings in third-party code, let me know if there's a better way to handle this.
Attachment #756882 - Flags: review?(ted)
Comment on attachment 756882 [details] [diff] [review]
Disable -Wreserved-user-defined-literal for problematic gstreamer header

Review of attachment 756882 [details] [diff] [review]:
-----------------------------------------------------------------

This is probably the least horrible way to do this. :-( Does clang support these pragmas (it won't error, at least, right)?
Attachment #756882 - Flags: review?(ted) → review+
Alternately if you wanted to protect against having this included elsewhere we could look into extending the system-headers wrappers.
Comment on attachment 756882 [details] [diff] [review]
Disable -Wreserved-user-defined-literal for problematic gstreamer header

(In reply to Ted Mielczarek [:ted.mielczarek] from comment #3)
> This is probably the least horrible way to do this. :-( Does clang support
> these pragmas (it won't error, at least, right)?

Yeah, this fixes the clang compile as well.
Attachment #756882 - Flags: checkin+
https://hg.mozilla.org/mozilla-central/rev/0692ed4ff443
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
The patch introduced a pragma warning for me. Slight change to silence *that* warning.
Attachment #760240 - Flags: review?(ted)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attachment #760240 - Flags: review?(ted) → review+
https://hg.mozilla.org/mozilla-central/rev/928d5b1c632f
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → FIXED
Bug 859199 broke this. Again. It seems tedious to file new bugs about it at this point.
Blocks: 859199
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Since Bug 859199 was a one-time change to how we load gstreamer, it's probably still sanest to just add another set of checks. I included comments to explain/apologize, at least.
Attachment #761203 - Flags: review?(ted)
Attachment #760240 - Flags: checkin+
Comment on attachment 761203 [details] [diff] [review]
Disable -Wreserved-user-defined-literal for (another) problematic gstreamer header

Review of attachment 761203 [details] [diff] [review]:
-----------------------------------------------------------------

:-/

::: content/media/gstreamer/GStreamerLoader.h
@@ +14,5 @@
>  #include <gst/app/gstappsink.h>
> +#pragma GCC diagnostic push
> +// older compilers complain about squelching the unknown warning
> +#pragma GCC diagnostic ignored "-Wpragmas"
> +// gst/video/video.h runs afowl of this warning on newer compilers

"afoul"
Attachment #761203 - Flags: review?(ted) → review+
Ugh. This new patch breaks building with clang 3.2 on Linux here...

37:48.74 In file included from /home/alex/mozilla-central/content/media/gstreamer/GStreamerDecoder.cpp:8:
37:48.74 /home/alex/mozilla-central/content/media/gstreamer/GStreamerReader.h:12:32: error: unknown warning group '-Wpragmas', ignored [-Werror,-Wunknown-pragmas]
37:48.74 #pragma GCC diagnostic ignored "-Wpragmas"
37:48.74                                ^
37:49.34 1 error generated.
37:49.34 
37:49.35 In the directory  /home/alex/mozilla-central/obj-x86_64-unknown-linux-gnu/content/media/gstreamer
37:49.35 The following command failed to execute properly:
37:49.37 /usr/bin/ccache clang++ -o GStreamerDecoder.o -c -I../../../dist/stl_wrappers -I../../../dist/system_wrappers -include /home/alex/mozilla-central/config/gcc_hidden.h -DMOZ_GLUE_IN_PROGRAM -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES -DSTATIC_EXPORTABLE_JS_API -DNO_NSPR_10_SUPPORT -I/home/alex/mozilla-central/content/media/gstreamer -I. -I../../../dist/include -I/home/alex/mozilla-central/obj-x86_64-unknown-linux-gnu/dist/include/nspr -I/home/alex/mozilla-central/obj-x86_64-unknown-linux-gnu/dist/include/nss -I/home/alex/mozilla-central/content/media/gstreamer/../../base/src -I/home/alex/mozilla-central/content/media/gstreamer/../../html/content/src -fPIC -Qunused-arguments -Qunused-arguments -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Wsign-compare -Wno-invalid-offsetof -Wno-c++0x-extensions -Wno-extended-offsetof -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-mismatched-tags -march=native -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -std=gnu++0x -I/home/alex/mozilla-central/build/unix/headers -pthread -pipe -DNDEBUG -DTRIMMED -g -Xclang -load -Xclang ../../../build/clang-plugin/libclang-plugin.so -Xclang -add-plugin -Xclang moz-check -O2 -fomit-frame-pointer -Werror -Wno-error=uninitialized -Wno-error=deprecated-declarations -pthread -I/usr/include/gstreamer-0.10 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libxml2 -Qunused-arguments -DMOZILLA_CLIENT -include ../../../mozilla-config.h -MD -MP -MF .deps/GStreamerDecoder.o.pp /home/alex/mozilla-central/content/media/gstreamer/GStreamerDecoder.cpp
Attached patch Fix build with Clang (obsolete) — Splinter Review
Clang doesn't support -Wpragmas so it complains when asked to disable it. (Somewhat ironically.)

It recognizes -Wunknown-pragmas which I'm assuming is the same thing.
Attachment #762405 - Flags: review?(ted)
Comment on attachment 762405 [details] [diff] [review]
Fix build with Clang

Review of attachment 762405 [details] [diff] [review]:
-----------------------------------------------------------------

Did I mention that this is the worst?
Attachment #762405 - Flags: review?(ted) → review+
FFFFFFFFF Okay. I sat down and tested this on everything. This makes both compilers happy, with a comment, with slightly less hideousness. Basically GCC does not have reserved-user-defined-literal, but ignoring it causes it to warn about suppressing an unknown warning (Wpragma), but suppressing THAT causes clang to complain via Wunknown-pragma. If we just ignore them in this order everything works without bringing ifdef into it. Hopefully.
Attachment #761203 - Attachment is obsolete: true
Attachment #762405 - Attachment is obsolete: true
Attachment #763769 - Flags: review?(ted)
Attachment 763769 [details] [diff] WORKSFORME on Clang + m-c 135495:d2a7cfa34154 (Tue Jun 18 19:04:48 2013 -0400).
Comment on attachment 763769 [details] [diff] [review]
Followup, fix compilers complaining about fixing other compilers complaining about an unknown warning.

Review of attachment 763769 [details] [diff] [review]:
-----------------------------------------------------------------

Please, make it stop! (Have you looked to see if this is fixed upstream in gstreamer?)
Attachment #763769 - Flags: review?(ted) → review+
Comment on attachment 763769 [details] [diff] [review]
Followup, fix compilers complaining about fixing other compilers complaining about an unknown warning.

https://hg.mozilla.org/integration/mozilla-inbound/rev/fdb7780fe53c
Attachment #763769 - Flags: checkin+
(In reply to Ted Mielczarek [:ted.mielczarek] from comment #19)
> Please, make it stop! (Have you looked to see if this is fixed upstream in
> gstreamer?)

This was fixed in gstreamer 0.10 trunk, but it's not clear if there will be a 0.10.37. GST1.x doesn't seem to be affected.
https://hg.mozilla.org/mozilla-central/rev/fdb7780fe53c
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → FIXED
(In reply to John Schoenick [:johns] from comment #20)
> Comment on attachment 763769 [details] [diff] [review]
> Followup, fix compilers complaining about fixing other compilers complaining
> about an unknown warning.
> 
> https://hg.mozilla.org/integration/mozilla-inbound/rev/fdb7780fe53c

(FWIW, this probably should have just used "#ifdef __clang__". That's the right way to prevent GCC from complaining about a pragma that's intended for another compiler.)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: