Sven Anderson
2008-Jan-23 15:57 UTC
[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) -------------- next part -------------- A non-text attachment was scrubbed... Name: dovecot-1.1.beta13.gcc_2_95.patch Type: text/x-patch Size: 2060 bytes Desc: not available URL: <http://dovecot.org/pipermail/dovecot/attachments/20080123/3da2c5f3/attachment-0002.bin>
Timo Sirainen
2008-Jan-31 15:36 UTC
[Dovecot] PATCH: compile dovecot-1.1.beta14 with gcc 2.95
On Wed, 2008-01-23 at 16:57 +0100, Sven Anderson wrote:> 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.Thanks, committed.> 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.char a[] is C99 standard, so I'll keep using that. There aren't many gcc 2.95 users anymore.> BTW.: There is a typo in src/login-common/main.c, it's equivalent, not > equilevant.Fixed. I noticed only a year or two ago that I had been misspelling it for ages. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20080131/f0143563/attachment-0002.bin>
Kevin A. McGrail
2008-Feb-26 17:48 UTC
[Dovecot] Follow-up re: gcc 2.96 - Re: PATCH: compile dovecot-1.1.beta14 with gcc 2.95
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)
>