GNOME Bugzilla – Bug 744485
[osx build] including gio/gio.h causes 'redefinition of typedef' warnings
Last modified: 2015-02-16 08:39:39 UTC
Created attachment 296799 [details] This patch adds -Wno-typedef-redefinition compile option On osx yosemite, compiling gstreamer with master of glib causes following warning. In file included from gstnetclientclock.c:58: In file included from ./gstnettimepacket.h:25: In file included from /mypath/install/include/glib-2.0/gio/gio.h:163: /mypath/install/include/glib-2.0/gio/glistmodel.h:36:21: error: redefinition of typedef 'GListModel' is a C11 feature [-Werror,-Wtypedef-redefinition] G_DECLARE_INTERFACE(GListModel, g_list_model, G, LIST_MODEL, GObject) Here is my gcc version information; $ gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.1.0 Thread model: posix This warning is caused by including gio/gio.h. But, as the warning says, redefinition of typedef is valid in C11 and no need to stop compiling for this. I attached a patch to add -Wno-typedef-redefinition compile option to configure.
Created attachment 296800 [details] [review] add -Wno-typedef-redefinition configure option
https://bugzilla.gnome.org/show_bug.cgi?id=744473 I also reported this problem to glib bugzilla. Glib guys might be able to patch avoiding the redefinition, but it would be great to make gstreamer can be built with current version of glib.
This should be fixed in GLib in one way or another, or be just part of your build flags. It's a warning caused in headers from another project, it IMHO doesn't make much sense to add compiler flags for that to GStreamer and every other project that uses GLib... and then the same for every other dependency of GStreamer that might create compiler warnings from its headers. *** This bug has been marked as a duplicate of bug 744473 ***