Subject: Re: sasl 2.1.13 compile problems
From: Jeremy Rumpf (jrumpf at heavyload dot net)
Date: Wed May 14 2003 - 14:54:42 EDT
On Wednesday 14 May 2003 11:33 am, Connie Starr Fensky wrote:
> I run HP-UX 11i, and use their ansic compiler instead of gcc. When I
> compiled the new saslauthd in sasl 2.1.13, I had a few minor problems,
> which I've (I believe ;-) fixed. I thought I'd send the diffs in in case
> anybody else runs into this (or in case anybody spots any problems with my
> fixes!). These are just plain diffs...
>
> <cache.c
>
Hmmmm, some confustion on pointer math. I'm not sure how the patch would
produce offsets.The physical layout is something (if my ascii art spares you)
Offset Use Variable/Init
0000 +-------------------------------+ void *base
| Cache magic string: | base = malloc();
| Identifies this as a cache |
| to external applications |
0064 +-------------------------------+ struct stats *table_stats
| Table stats struct: | table_stats=base + 64;
| Stores stats for external |
| viewing and pleasure |
0192 +-------------------------------+ struct bucket *table
| Main hash table |(char *)table=(char *)table_stats+128;
| |
| |
XXXX +-------------------------------+
Then that whole mess is mmap(ed) out to a file.
> >cache.c.orig
>
> 133c133
> < table_stats = (void *)((int)base + 64);
> ---
>
> > table_stats = base + 64;
The only issue I may see with that is if an integer can't hold a 64bit
pointer, aka the integer is 32bits holding a 64bit void * pointer. Would
casting the void *base to an int truncate it under some situations? I don't
know enough about compilers to say.
>
> 140c140
> < table = (char *)((int)table_stats + 128);
> ---
>
> > (char *)table = (char *)table_stats + 128;
>
Same as above with the base variable.
> < ipc_unix.c
>
> >ipc_unix.c.orig
>
> 49c49
> < #warning compiling in unix ipc
> ---
>
> /*#warning compiling in unix ipc */
>
We can just ditch the warning message, purely just so I could verify what was
being compiled in when writing it.
> <utils.c
>
> >utils.c.orig
>
> 116c116
> < buff += bytesio;
> ---
>
> > buff = (void *)(bytesio + (int)buff);
>
> 153c153
> < buff += bytesio;
> ---
>
> > buff = (void *)(bytesio + (int)buff);
>
> c*
Same issue with casting a void * to an int.
Of course I could have this thing all screwed up :) Can anyone else comment?
I have access to a sun box with the pro c compiler installed, lemme play with
it a bit.
Jeremy
|
|
|