Cannot compile cyrus-2.2.2-BETA with Sun compiler (lib/imapopts.c)

Paul Boven p.boven at chello.nl
Wed Nov 26 15:45:11 EST 2003


Hi Christos, list,

Christos Soulios wrote:

> This is caused because of the fact that Sun compiler is stricter on C standards.
>  Ansi C forbids the type casting to a union. However, it is implemented as an
> extension by gcc. In my opinion this is wrong, because it violates some C
> standards. 
> 
> In this case you may compile cyrus 2.2.2-BETA if you remove the '(union
> config_value)' from all the lines of imapopts.c
> 
> Then the compilation will continue throwing only some warnings until it breaks
> later in file lib/libcyr_cfg.c where there is another union type cast. (
> (union cyrus_config_value))
> 
> You must remove this too and the compilation will end normally. 

I've removed those, and after some more online research added an
#include <config.h> to the top of lib/prot.h and everything compiles 
now. However, starting it up results in a crash:

core 'core' of 6151:    /usr/local/cyrus/bin/master -D
  feec3cb4 _free_unlocked (ffbff91a, 783b8, 0, fef3c000, 0, 0) + 40
  feec3c64 free     (ffbff91a, 0, 0, 0, 0, 0) + 20
  ff3248b0 freeaddrinfo (3e420, af02aae8, 18, 3, 4, fef1ef2c) + 34
  00014a50 service_create (413d4, 18a38, 0, 7efefeff, 81010100, ff00) + 8b8
  0001a0c4 main     (2, ffbffcac, ffbffcb8, 32000, 0, 0) + ab4
  00013930 _start   (0, 0, 0, 0, 0, 0) + 108

> For the time being removing these union castings is harmless for the binaries
> and cyrus function, but there are cases when this may break things down. And I
> am afraid that this will happen in some future release.
> I think that the cyrus developers should deal with this problem, other than gcc
> compilers are excluded. 

Agreed, I'll try to help with that, at least documenting all the 
gotcha's I ran across getting this to compile. Now I just need to get it 
to run :-)

Regards, Paul Boven.





More information about the Info-cyrus mailing list