Bug 30644 - Telepathy-glib fails to compile with sun studio c
Summary: Telepathy-glib fails to compile with sun studio c
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-glib (show other bugs)
Version: 0.12
Hardware: Other Solaris
: medium normal
Assignee: Simon McVittie
QA Contact: Telepathy bugs list
URL: http://git.collabora.co.uk/?p=user/sm...
Whiteboard: r+
Keywords: patch
Depends on:
Blocks:
 
Reported: 2010-10-06 01:47 UTC by Daniel Vergien
Modified: 2010-10-13 09:07 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Daniel Vergien 2010-10-06 01:47:55 UTC
Using sun studio c thelepathy-glib fails like this:

"channel-manager.c", line 616: void function cannot return value
cc: acomp failed for channel-manager.c

This can be worked around with adding "-features=extensions" to CFLAGS if sun c compiler is used.
Comment 1 Simon McVittie 2010-10-06 04:38:17 UTC
(In reply to comment #0)
> "channel-manager.c", line 616: void function cannot return value
> cc: acomp failed for channel-manager.c

Fixed in a branch and awaiting code review for the next 0.12.x release, along with some other low-hanging "gcc -std=c99 -pedantic" warnings.

I was curious about whether we could detect this automatically, so I tried compiling telepathy-glib with "gcc -Werror -std=c99 -pedantic". It seems we also rely on the following common extensions:

- passing a function pointer where a void* is expected or vice versa (GLib and GIO rely heavily on this working, so there's nothing we can do about that)

- variadic macros that don't have any arguments corresponding to the "..."

- passing a Something* to a printf-style function that expects a void*

Changing any of these would make our code much less readable, so I don't propose to change any of them; you may need to give your compiler a suitable flag to make it allow them.
Comment 2 Guillaume Desmottes 2010-10-12 07:36:56 UTC
++
Comment 3 Simon McVittie 2010-10-13 09:07:22 UTC
Fixed in git for versions 0.13.2 and 0.12.1.


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.