Re: Bug compiling 2.2.stable2 under sgi

From: Dancer <dancer@dont-contact.us>
Date: Fri, 30 Apr 1999 06:46:31 +1000

Chris Tilbury wrote:
>
> On Thu, Apr 29, 1999 at 04:15:21PM +0200, Rainer Klier wrote:
>
> > Hi...
> >
> > tried to compile squid 2.2.stable2 under irix 6.5 with mips 7.2.1.2m
> > an ran in the folling error:
> >
> > cc -g -I. -I../include -I../include -c delay_pools.c -o delay_pools.o
> > "delay_pools.c", line 117: error(1138): expression must have
> > pointer-to-object
> > type
> > return b - a;
> > ^
> >
> > 1 error detected in the compilation of "delay_pools.c".
> > make[1]: *** [delay_pools.o] Error 2
> > make[1]: Leaving directory `/proxy/src/squid-2.2.STABLE2/src'
> > make: *** [all] Error 1
> >
> > Any clues about this ?
>
> It'll probably be the same problem afflicting other vendors compilers
> -- the DEC UNIX and Sun Workshop compilers both can't compile this
> function (delayIdPtrHashCmp).
>
> The code is trying to do arithmetic on pointers to void. This works
> under GNU C, because GNU C specifically defines sizeof(void) to be
> 1. sizeof(void) is undefined on these other compilers however and thus
> this won't work.
>
> If you can somehow convince your compilers to let you do this kind of
> pointer arithmetic (via a command line option, probably), then you
> might coax this into working. Otherwise, you'll need to use gcc/egcs
> for now.
>
> Cheers,
>

Try:

        return (void *) ((unsigned long)b - (unsigned long)a);

or cast them to char * instead of unsigned long if that makes you feel
more comfortable. On some architectures it would be preferable.

D
Received on Thu Apr 29 1999 - 16:18:04 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:46:08 MST