Subject: Re: make build error with Mar 23, 96
To: CHAN Yiu Wah <clarence@cs.cuhk.hk>
From: Roland C Dowdeswell <roland@imrryr.org>
List: current-users
Date: 03/25/1996 04:38:35
On 827730620 seconds since the Beginning of the UNIX epoch CHAN Yiu Wah wrote:
>
>Hello,
>
>I tried to make build with Mar 23, 96 source, I got the following error
>
>======= Error =======
>cc1plus: warnings being treated as errors
>y.tab.c: In function `int yygrowstack()':
>y.tab.c:3413: warning: ANSI C++ forbids implicit conversion from `void
>*' in assignment
>y.tab.c:3417: warning: ANSI C++ forbids implicit conversion from `void
>*' in assignment
>*** Error code 1
>
>Stop.
>======= Error =======
>
>Is there anyone has the same problem ?  Please share your expeerience
>with me. Thank you in advance.
>
>cheers,
>
>clarence
>clarene@cs.cuhk.hk

Yes, I got the same error.  I just did a temp 'fix' by putting a
 (short *) and a (YYSTYPE *) before two reallocs in the files
gnu/usr.bin/groff/pic/pic.cc,
gnu/usr.bin/groff/eqn/eqn.cc, and I think that last one was
gnu/usr.bin/groff/refer/label.cc.

It looks like the files are generated by yacc, though,
so the problem will occur again if you let yacc regen the
files in question.

Perhaps (although I have not tried this :) if one tried this
diff on yacc:  Hold on, let me try it...

it seems to work..  At least on those files that I mentioned,
haven't tried a full build.  I do not think that this change
would cause any problems for anything else, but keep in mind
that this is the first time that I have so much as glanced
at the source of yacc...

skeleton.c is in src/usr.bin/yacc/

*** skeleton.c.orig     Mon Mar 25 04:29:04 1996
--- skeleton.c  Mon Mar 25 04:29:28 1996
***************
*** 145,155 ****
      "    else if ((newsize *= 2) > YYMAXDEPTH)",
      "        newsize = YYMAXDEPTH;",
      "    i = yyssp - yyss;",
!     "    if ((newss = realloc(yyss, newsize * sizeof *newss)) == NULL)",
      "        return -1;",
      "    yyss = newss;",
      "    yyssp = newss + i;",
!     "    if ((newvs = realloc(yyvs, newsize * sizeof *newvs)) == NULL)",
      "        return -1;",
      "    yyvs = newvs;",
      "    yyvsp = newvs + i;",
--- 145,155 ----
      "    else if ((newsize *= 2) > YYMAXDEPTH)",
      "        newsize = YYMAXDEPTH;",
      "    i = yyssp - yyss;",
!     "    if ((newss = (short *) realloc(yyss, newsize * sizeof *newss)) == NULL)",
      "        return -1;",
      "    yyss = newss;",
      "    yyssp = newss + i;",
!     "    if ((newvs = (YYSTYPE *) realloc(yyvs, newsize * sizeof *newvs)) == NULL)",
      "        return -1;",
      "    yyvs = newvs;",
      "    yyvsp = newvs + i;",

--
/* Roland C Dowdeswell
 * http://www.imrryr.org/
 */