Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: frank@niagara.nyo.dec.com (Frank Wortner)
Subject: Re: Perl and OSF/1
Date: Tue, 9 Aug 1994 14:33:58 GMT	[thread overview]
Message-ID: <1994Aug9.143358.8024@datum.nyo.dec.com> (raw)
In-Reply-To: Cu8BD6.4uu@news.tufts.edu


In article <Cu8BD6.4uu@news.tufts.edu>, mcable@musketeers.tufts.edu (Matt Cable) writes:
|>
|>Allright folks...got another question for you all.
|>
|>
|>
|>I've compiled perl succesfully on out OSF/1 1.3 machine, with only one error during compilation:
|>
|>`sh  cflags eval.o` eval.c
|>          CCCMD =  cc -c -Olimit 2900 -D__STDC__ -DLANGUAGE_C -O  
|>/usr/lib/cmplrs/cc/cfe: Warning: eval.c, line 1674: Incompatible pointer type as
|>signment
|>        value = (double) time(((long*)0));
|>        -----------------------^

Change the (long *) to a (time_t *).

|>Despite this, a make test gives no errors and all tests succeed.

Yeah, since the null pointer is never dereferenced, the fact that it's
pointing to an object of the wrong size doesn't matter.  Of course, that's
an accident of implementation.  :-)

|>however, when attempting to run man-pl with this new perl, it seg faults before compilation is complete, thereby killing any hopes of running perl in debug mode to figure out the problem.  All other scripts I've tried have worked, and man-pl works fine on other systems I'm working on.  I compiled perl with -D__STDC__ as recommended to me after earlier problems, but it seems the problem still remains.  Anyone have any ideas why this might be and what I can do to fix it?
|>

The problem is in the hash routines in hash.c.  Here's a patch you
can apply.  I found this problem a while ago, since I also use the
PERL man program.

rcsdiff -c -r1.1 -r1.2 hash.c
===================================================================
RCS file: RCS/hash.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -c -r1.1 -r1.2
*** 1.1 1994/05/31 14:53:32
--- 1.2 1994/08/05 18:31:02
***************
*** 6,11 ****
--- 6,14 ----
   *    License or the Artistic License, as specified in the README file.
   *
   * $Log: hash.c,v $
+  * Revision 1.2  1994/08/05  18:31:02  frank
+  * Added explict checks for non-zero to hash functions.
+  *
+  * Revision 1.1  1994/05/31  14:53:32  frank
+  * Initial revision
   *
***************
*** 75,81 ****
       * same letter don't have to be strEQ'ed within hfetch(), since it
       * compares hash values before trying strEQ().
       */
!     if (!tb->tbl_coeffsize)
        hash = *key + 128 * key[1] + 128 * key[klen-1]; /* assuming klen > 0 */
      else {    /* use normal coefficients */
        if (klen < tb->tbl_coeffsize)
--- 78,84 ----
       * same letter don't have to be strEQ'ed within hfetch(), since it
       * compares hash values before trying strEQ().
       */
!     if (!tb->tbl_coeffsize && klen > 0)
        hash = *key + 128 * key[1] + 128 * key[klen-1]; /* assuming klen > 0 */
      else {    /* use normal coefficients */
        if (klen < tb->tbl_coeffsize)
***************
*** 144,150 ****
      if (hash)
        /*SUPPRESS 530*/
        ;
!     else if (!tb->tbl_coeffsize)
        hash = *key + 128 * key[1] + 128 * key[klen-1];
      else {    /* use normal coefficients */
        if (klen < tb->tbl_coeffsize)
--- 147,153 ----
      if (hash)
        /*SUPPRESS 530*/
        ;
!     else if (!tb->tbl_coeffsize && klen > 0)
        hash = *key + 128 * key[1] + 128 * key[klen-1];
      else {    /* use normal coefficients */
        if (klen < tb->tbl_coeffsize)
***************
*** 232,238 ****

      if (!tb || !tb->tbl_array)
        return Nullstr;
!     if (!tb->tbl_coeffsize)
        hash = *key + 128 * key[1] + 128 * key[klen-1];
      else {    /* use normal coefficients */
        if (klen < tb->tbl_coeffsize)
--- 235,241 ----

      if (!tb || !tb->tbl_array)
        return Nullstr;
!     if (!tb->tbl_coeffsize && klen > 0)
        hash = *key + 128 * key[1] + 128 * key[klen-1];
      else {    /* use normal coefficients */
        if (klen < tb->tbl_coeffsize)


      reply	other threads:[~1994-08-09 14:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-08-08 18:29 Perl and OSF/1 Matt Cable
1994-08-09 14:33 ` Frank Wortner [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox