GNOME Bugzilla – Bug 613663
New warnings in osx plugins
Last modified: 2010-04-12 23:20:55 UTC
Created attachment 156833 [details] [review] fixes compilation warnings for os x plugins Because of the added warnings from commit 4f5a49a4c7f36b822dd43cce339b066bbf0a7d47 , plugins-good compilation now outputs these warnings: cc1: warnings being treated as errors gstosxaudioelement.c: In function ‘gst_osx_audio_element_get_type’: gstosxaudioelement.c:57: warning: old-style function definition make[3]: *** [libgstosxaudio_la-gstosxaudioelement.lo] Error 1 make[3]: *** Waiting for unfinished jobs.... mv -f .deps/libgstosxaudio_la-gstosxaudiosrc.Tpo .deps/libgstosxaudio_la-gstosxaudiosrc.Plo make[3]: Leaving directory `/Users/tristanmatthews/gst-plugins-good/sys/osxaudio' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/Users/tristanmatthews/gst-plugins-good/sys' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/Users/tristanmatthews/gst-plugins-good' make: *** [all] Error 2 cc1obj: warnings being treated as errors cocoawindow.m: In function ‘-[GstGLView reshape]’: cocoawindow.m:161: warning: function call has aggregate value cocoawindow.m: In function ‘-[GstGLView displayTexture]’: cocoawindow.m:289: warning: function call has aggregate value make[3]: *** [libgstosxvideosink_la-cocoawindow.lo] Error 1 make[3]: Leaving directory `/Users/tristanmatthews/gst-plugins-good/sys/osxvideo' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/Users/tristanmatthews/gst-plugins-good/sys' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/Users/tristanmatthews/gst-plugins-good' make: *** [all] Error 2
I applied the patch to get the code compiling again, but we need a proper fix for the aggregate return warning, so I'm leaving this open. We shouldn't use -Waggregate-return for Objective C, but there is no OBJCFLAGS in our configure machinery. I see 3 options but am not sure about which are best: 1) Remove -Waggregate-return from the CFLAGS 2) Use the CXXFLAGS, they don't include that warning 3) Add OBJCFLAGS Opinions?
OBJCFLAGS seems like "the right thing", it was the first thing i looked for when i patched this.
What's the point of -Waggregate-return? (I understand what it does, but I don't understand why that needs to be avoided/warned about)
I always used it to ensure consistency - All GNOME/GStreamer code avoids aggregate retuns so it's always been good idea. And I assumed the gcc developers had a good reason to add it (You don't want to add warnings that are useless) but all I could find so far were issues with compilers and platforms that were probably last used in the last century. So there's definitely no very good reason for this warning.
Marking as blocker, should do something about this for the release. I guess we can pretty much assume that the compiler will be gcc on OSX, can't we? In which case hard-coding -Wno-aggregate-return would seem ok as quickfix. Or we could just remove that warning in configure..
Sooner or later people will start compiling with llvm/clang, but until that happens, we can probably keep the current hardcoded -Wno-aggregate-return.
commit f30f907c37c86df0e24fc96d4b43a3d8f4acdc23 Author: Tim-Philipp Müller <tim.muller@collabora.co.uk> Date: Tue Apr 13 00:14:46 2010 +0100 configure: also remove -Waggregate-return from warning flags It causes problems with Objective-C code like in osxvideosink. Fixes #613663.