../telepathy-glib/base-call-content.h:35:35: error: redefinition of typedef 'TpBaseCallChannel' ../telepathy-glib/base-call-stream.h:33:35: note: previous declaration of 'TpBaseCallChannel' was here In file included from base-call-channel.c:103:0: base-call-channel.h:30:35: error: redefinition of typedef 'TpBaseCallChannel' ../telepathy-glib/base-call-content.h:35:35: note: previous declaration of 'TpBaseCallChannel' was here In file included from base-call-channel.c:108:0: ../telepathy-glib/base-call-internal.h:30:35: error: redefinition of typedef 'TpBaseCallChannel' base-call-channel.h:30:35: note: previous declaration of 'TpBaseCallChannel' was here ../telepathy-glib/base-call-internal.h:31:35: error: redefinition of typedef 'TpBaseCallContent' Latest tp-glib fails to build with similar errors in both platforms ../telepathy-glib/base-call-content.h:37:35: note: previous declaration of 'TpBaseCallContent' was here ../telepathy-glib/base-call-internal.h:32:35: error: redefinition of typedef 'TpBaseCallStream' ../telepathy-glib/base-call-stream.h:35:34: note: previous declaration of 'TpBaseCallStream' was here In file included from ../telepathy-glib/base-media-call-stream.h:25:0, from base-call-channel.c:109: ../telepathy-glib/call-stream-endpoint.h:33:38: error: redefinition of typedef 'TpCallStreamEndpoint' ../telepathy-glib/base-call-internal.h:37:38: note: previous declaration of 'TpCallStreamEndpoint' was here In file included from base-call-channel.c:109:0: ../telepathy-glib/base-media-call-stream.h:29:39: error: redefinition of typedef 'TpBaseMediaCallStream' ../telepathy-glib/base-call-internal.h:36:39: note: previous declaration of 'TpBaseMediaCallStream' was here make[2]: *** [base-call-channel.lo] Error 1 make[2]: Leaving directory `/var/lib/buildbot/telepathy/telepathy-glib-win/build/telepathy-glib' make[1]: *** [install] Error 2 make: *** [install-recursive] Error 1 make[1]: Leaving directory `/var/lib/buildbot/telepathy/telepathy-glib-win/build/telepathy-glib' program finished with exit code 2 elapsedTime=47.038328 See here for more details: Windows build: http://buildbot.telepathy.im:8010/builders/telepathy-glib%20-%20windows/builds/16 Android build: http://buildbot.telepathy.im:8010/builders/telepathy-android%20-%20r10/builds/59
What compiler version are you using? I'd like to be warned about this when not cross-compiling, too. I believe my forward-decl branch fixes this.
Created attachment 57393 [details] [review] Avoid forward-declaring Call classes Having more than one typedef for the same name is an error. If forward declarations are needed to break cycles, the typedef must be *moved* (not copied) from the header it'd normally appear in to the header with the forward declaration: for instance, TpCallContent (forward-declared in call-channel.h) gets this right. In extreme cases, a global "types.h" header can forward-declare everything, although that often leads to unnecessary compilation, so we've avoided it in telepathy-glib.
(In reply to comment #1) > What compiler version are you using? I'd like to be warned about this when not > cross-compiling, too. For Windows, we use mingw32. For Android, NDK R6. I dunno how we can prevent this, other than using latest gcc with all warnings enabled, and paying attention to buildbot fails. In this, at least 6 other projects broke up and that is reported in IRC.
(In reply to comment #3) > For Windows, we use mingw32. For Android, NDK R6. Those are platforms. Which compiler version do they contain? I assume it's some sort of gcc in both cases? I didn't get these warnings with Debian's gcc 4.6.2-15, and I can't find an option to enable them, which is unfortunate, since it's an error to have multiple declarations like this.
*** Bug 46396 has been marked as a duplicate of this bug. ***
Comment on attachment 57393 [details] [review] Avoid forward-declaring Call classes Review of attachment 57393 [details] [review]: ----------------------------------------------------------------- ++
Created attachment 57399 [details] [review] Avoid forward-declaring Call classes Missed one, added a updated patch based on the previous patch
(In reply to comment #4) > (In reply to comment #3) > > For Windows, we use mingw32. For Android, NDK R6. > > Those are platforms. Which compiler version do they contain? I assume it's some > sort of gcc in both cases? > To build for Windows, we use mingw32-gcc 4.5.3, running on Fedora 15 To build for Android, we use the Android NDK Release 6, which uses its own compiler and libc library (bionic).
Comment on attachment 57399 [details] [review] Avoid forward-declaring Call classes Review of attachment 57399 [details] [review]: ----------------------------------------------------------------- ::: telepathy-glib/base-call-channel.h @@ +24,4 @@ > > #include <telepathy-glib/base-channel.h> > #include <telepathy-glib/base-call-content.h> > +#include <telepathy-glib/base-call-stream.h> The forward declaration in this header seems to be unnecessary, so I'd prefer to just drop it. Additional patch on the way.
Created attachment 57400 [details] [review] Remove another unnecessary forward-declaration of TpBaseCallChannel
Everything compiles as expected with clang after applying these 2 patches :)
(In reply to comment #2) > Having more than one typedef for the same name is an error. ... but not in drafts of C1X, apparently, which is why gcc 4.6 no longer treats it as an error. Still, we generally try to stick to C89 (!) because MSVC still hasn't caught up with C99, so we should certainly avoid relying on C1X.
Fixed in git for 0.17.6
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.