public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* solaris8 error
@ 2002-08-10 11:15 Benjamin Franks
  0 siblings, 0 replies; only message in thread
From: Benjamin Franks @ 2002-08-10 11:15 UTC (permalink / raw)
  To: gcc-help

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);
}




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-08-10 18:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-10 11:15 solaris8 error Benjamin Franks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).