This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
solaris8 error
- From: Benjamin Franks <benjamin at dzhan dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Sat, 10 Aug 2002 11:27:51 -0700 (PDT)
- Subject: solaris8 error
The following c hashing function has compiled/executed fine on various
unices (linux, freebsd, some solaris versions). However, although it
compiles ok on Solaris 8, it faults when it is called. Can someone
familiar with Solaris weigh in on why this relatively standard hashing
function (ala P.J. Weinberger) would be causing trouble on Solaris 8?
This is still for a 32bit ultra1, so not a 64-bit setup, and using the gcc
compiler.
Thanks.
------
unsigned int hashpjw (const void *key) {
const char *ptr;
unsigned int val;
val=0;
ptr=key;
while (*ptr != '\0') {
int tmp;
val = (val << 4) + (*ptr);
if (tmp = (val & 0xf0000000)) {
val = val ^ (tmp >> 24);
val &= ~tmp;
}
ptr++;
}
return (val%BIG_MAX);
}