#667 closed defect (fixed)

Compilation problems on Solaris

Reported by: Dagobert Michelsen <dam@…> Owned by:
Priority: normal Milestone:
Component: BitlBee Version: 1.2.7
Keywords: Cc:
IRC client+version: Client-independent Operating System: Other
OS version/distro: Solaris 9 Sparc/x86



I have compiled bitlbee stable/release 1.2.8 (not listed on version popup so I selected 1.2.7 there) on Solaris 9 Sparc and x86 and encountered some portability issues:

  • The Makefile unconditionally add -Wall which is not supported by Sun Studio compiler
  • In conf.c and unix.c the function setenv is used where Solaris only has putenv
  • The header stdint.h is used where Solaris only has inttypes.h
  • In some function the idiom return myfunc(args); is used although the function is declared to return void. This is an error when compiling with Sun Studio.
  • The ternary-operator is used with the idiom myvalue ? : "something" leaving the second part empty instead of myvalue ? myvalue : "something". This is also not allowed in Sun Studio
  • The explicit definition of _XOPEN_SOURCE in protocols/twitter/twitter_lib.c confuses the include order and must not be defined in this context on Solaris.

I have patches attached to this bug that make bitlbee compilable on Solaris, however, some of them have are hacked together and a clean solution would be favorable.

Additionally, we offer access to the OpenCSW buildfarm to upstream projects for regular testing on Solaris. Feel free to contact me for an account:

Attachments (7)

0001-Do-not-use-gcc-specific-Wall.patch (908 bytes) - added by Dagobert Michelsen <dam@…> at 2010-08-06T15:45:09Z.
0002-Use-putenv-instead-of-setenv.patch (1.2 KB) - added by Dagobert Michelsen <dam@…> at 2010-08-06T15:45:17Z.
0003-Remove-more-GCC-specific-Wall.patch (2.7 KB) - added by Dagobert Michelsen <dam@…> at 2010-08-06T15:45:26Z.
0004-Use-inttypes.h-instead-of-stdint.h.patch (1.2 KB) - added by Dagobert Michelsen <dam@…> at 2010-08-06T15:45:37Z.
0005-Do-not-return-values-in-void-functions-and-make-seco.patch (8.0 KB) - added by Dagobert Michelsen <dam@…> at 2010-08-06T15:45:45Z.
0006-Remove-definition-on-Solaris-confusing-includes.patch (1.0 KB) - added by Dagobert Michelsen <dam@…> at 2010-08-06T15:45:52Z.
0007-Honour-CPPFLAGS.patch (636 bytes) - added by Dagobert Michelsen <dam@…> at 2010-08-06T15:46:00Z.

Download all attachments as: .zip

Change History (9)

Changed at 2010-08-06T15:45:09Z by Dagobert Michelsen <dam@…>

Changed at 2010-08-06T15:45:17Z by Dagobert Michelsen <dam@…>

Changed at 2010-08-06T15:45:26Z by Dagobert Michelsen <dam@…>

Changed at 2010-08-06T15:45:37Z by Dagobert Michelsen <dam@…>

Changed at 2010-08-06T15:45:45Z by Dagobert Michelsen <dam@…>

Changed at 2010-08-06T15:45:52Z by Dagobert Michelsen <dam@…>

Changed at 2010-08-06T15:46:00Z by Dagobert Michelsen <dam@…>

Attachment: 0007-Honour-CPPFLAGS.patch added

comment:1 Changed at 2010-08-07T16:35:59Z by wilmer

Resolution: fixed
Status: newclosed

Thanks for the patches! Note that 1.2.8 is old code and what is currently in bzr is a fairly major rewrite. Most of the patches applied, but you may find new issues in head. Feel free to submit more patches to fix those. I'll try to remember the ?: issue myself.

-Wall is now set in the configure script if $CC contains gcc.

BTW, this part was dangerous:

        if( node == NULL )
-               return xt_cleanup( xt, xt->root, depth );
+               xt_cleanup( xt, xt->root, depth );
+               return;

Please be careful when making changes like this, since it can introduec hard to find bugs.

comment:2 Changed at 2010-08-07T20:09:38Z by Dagobert Michelsen <dam@…>

Thanks for applying the patches and especially for catching my short-sighted syntactic replacement. It is always good to have another pair of eyes on patches :-)

Modify Ticket

as closed The ticket will remain with no owner.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.