[Dovecot] Follow-up re: gcc 2.96 - Re: PATCH: compile dovecot-1.1.beta14 with gcc 2.95

Kevin A. McGrail kmcgrail at pccc.com
Tue Feb 26 19:48:19 EET 2008


As a follow-up on this, these two lines also helped me to compile the 1.1rc1 
on gcc 2.96:

diff -ru dovecot-1.1.beta13/src/lib/str-find.c 
dovecot-1.1.beta13.patched/src/lib/str-find.c
--- dovecot-1.1.beta13/src/lib/str-find.c       Tue Oct 23 16:01:16 2007
+++ dovecot-1.1.beta13.patched/src/lib/str-find.c       Thu Jan 17 14:08:03 
2008
@@ -12,7 +12,7 @@
        unsigned int match_count;

        int badtab[UCHAR_MAX+1];
-       int goodtab[];
+       int goodtab[0];
 };

 static void init_badtab(struct str_find_context *ctx)
diff -ru dovecot-1.1.beta13/src/lib-imap/imap-match.c 
dovecot-1.1.beta13.patched/src/lib-imap/imap-match.c
--- dovecot-1.1.beta13/src/lib-imap/imap-match.c        Sun Dec  9 19:14:27 
2007
+++ dovecot-1.1.beta13.patched/src/lib-imap/imap-match.c        Thu Jan 17 
14:09:02 2008
@@ -19,7 +19,7 @@
        struct imap_match_pattern *patterns;

        char sep;
-       char patterns_data[];
+       char patterns_data[0];
 };

Regards,
KAM

----- Original Message ----- 
From: "Sven Anderson" <sven at anderson.de>
To: <dovecot at dovecot.org>
Sent: Wednesday, January 23, 2008 10:57 AM
Subject: [Dovecot] PATCH: compile dovecot-1.1.beta14 with gcc 2.95


> Hi,
>
> I patched dovecot-1.1.beta14 to compile under gcc 2.95. __builtin_expect
> and __attribute__((malloc)) are only available since gcc 3.0, and
> __builtin_types_compatible_p since 3.1.
>
> Also the flexible array members (char a[]) are not available for gcc
> 2.95. So I replaced them with zero-extent arrays (char a[0]), which
> should also work, but that is gcc specific. A general pointer (char* a)
> should work as well, I guess.
>
> I have attached a patch that fixes all this. It is for beta13 but also
> works on beta14.
>
> BTW.: There is a typo in src/login-common/main.c, it's equivalent, not
> equilevant.
>
>
> Cheers,
>
> Sven
>
> -- 
> http://sven.anderson.de    "Believe those who are seeking the truth.
> tel:    +49-551-9969285     Doubt those who find it."
> mobile: +49-179-4939223                                 (André Gide)
> 



More information about the dovecot mailing list