Summary: | tp-glib fails to build on Android and windows | ||
---|---|---|---|
Product: | Telepathy | Reporter: | Alvaro Soliverez <alvaro.soliverez> |
Component: | tp-glib | Assignee: | Simon McVittie <smcv> |
Status: | RESOLVED FIXED | QA Contact: | Telepathy bugs list <telepathy-bugs> |
Severity: | major | ||
Priority: | medium | CC: | rohan |
Version: | git master | Keywords: | patch |
Hardware: | Other | ||
OS: | All | ||
URL: | http://cgit.freedesktop.org/~smcv/telepathy-glib/commit?h=forward-decl | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
Avoid forward-declaring Call classes
Avoid forward-declaring Call classes Remove another unnecessary forward-declaration of TpBaseCallChannel |
Description
Alvaro Soliverez
2012-02-21 03:28:56 UTC
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.