Build trouble, and patch suggestions
Paul Boven
p.boven at chello.nl
Sun Mar 16 08:57:23 EST 2003
Hi again, following up to myself:
Paul Boven wrote:
> The next problem I can't fix as easily. When compiling imap/squat.c:
> "./../lib/xmalloc.h", line 69: syntax error before or at: __attribute__
> "./../lib/xmalloc.h", line 69: warning: old-style declaration or
> incorrect type for: __attribute__
> "./../lib/xmalloc.h", line 69: warning: syntax error: empty declaration
> cc: acomp failed for squat.c
>
> The system in question is a Solaris 9 machine, using Sun One
> Compiler-Collection (aka Forte 7).
The problem here is that __attribute__ is a GCC-ism, not quite
compatible with other compilers.
A solution is listed in the section "Compatability with non-GNU
compilers" on
http://www.unixwiz.net/techtips/gnu-c-attributes.html
Applying this to the top of lib/xmalloc.h solved my problem. Suggested
patch:
*** xmalloc.h.orig Sun Mar 16 14:46:18 2003
--- xmalloc.h Sun Mar 16 14:47:00 2003
***************
*** 43,48 ****
--- 43,52 ----
#ifndef INCLUDED_XMALLOC_H
#define INCLUDED_XMALLOC_H
+ /* If we're not using GNU C, elide __attribute__ */
+ #ifndef __GNUC__
+ # define __attribute__(x) /*NOTHING*/
+ #endif
/* for size_t */
#include <stdio.h>
Regards, Paul Boven.
More information about the Info-cyrus
mailing list