Bug 30644

Summary: Telepathy-glib fails to compile with sun studio c
Product: Telepathy Reporter: Daniel Vergien <daniel.vergien>
Component: tp-glibAssignee: Simon McVittie <smcv>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium Keywords: patch
Version: 0.12   
Hardware: Other   
OS: Solaris   
URL: http://git.collabora.co.uk/?p=user/smcv/telepathy-glib-smcv.git;a=shortlog;h=refs/heads/012-pedantic
Whiteboard: r+
i915 platform: i915 features:

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.