[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IMAP compile errors




>> The IMAP documentation states there is a problem with gcc-2.95 on the
>> sparc when compiling imapd - I guess you just hit it.
>> 
>> Their solution was to go back to gcc-2.8, but this may be harder to
>> do on OpenBSD compared with Solaris.  (The UW people talked of this
>> problem only in relation to Solaris, but I guess the gcc is gcc.)
>Try compiling this specific file with -O0. I assume the imap people already
>reported the bug to the gcc mailing-list, did they ? otherwise, if it's not
>fixed in gcc 3.0, too bad for them.

Nope, using "-O0" doesn't help.  (I only tested this with Solaris, I
don't currently have a OpenBSD/sparc box running at the mo.)

I've no idea whether the bug was reported.  I went looking on the gcc
mailing lists for info, but did not find any specific reference to
imap.  But then maybe I didn't look hard enough.

Looking at the code, it's a bit scary...  But I've found a fix!!!

I hope it does the right thing...  Let me know what you think!

Cheers,


Duncan.


-----------------------------------------------------------------------------

diff -r -u imap-2000-orig/src/osdep/unix/mbx.c imap-2000/src/osdep/unix/mbx.c
--- imap-2000-orig/src/osdep/unix/mbx.c	Wed Oct 25 00:40:54 2000
+++ imap-2000/src/osdep/unix/mbx.c	Mon Nov 20 15:23:05 2000
@@ -1333,7 +1333,9 @@
 				/* paranoia check */
   if (LOCAL->buflen < (HDRBUFLEN + SLOP)) {
     fs_give ((void **) &LOCAL->buf);
-    LOCAL->buf = (char *) fs_get ((LOCAL->buflen = HDRBUFLEN) + SLOP);
+    /* LOCAL->buf = (char *) fs_get ((LOCAL->buflen = HDRBUFLEN) + SLOP); */
+    LOCAL->buflen = HDRBUFLEN;
+    LOCAL->buf = (char *) fs_get (LOCAL->buflen + SLOP);
   }
   lseek (LOCAL->fd,ret,L_SET);	/* get to header position */
   for (siz = 0, s = LOCAL->buf;	/* read HDRBUFLEN chunks with 4 byte slop */