[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: signed < unsigned
From: |
Akim Demaille |
Subject: |
Re: signed < unsigned |
Date: |
18 Jul 2001 18:24:14 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Academic Rigor) |
| I'm really sorry, but that wasn't the good patch, the following patch
| is ok, sorry again.
|
| --- src/bison.simple.origin Wed Jul 18 18:05:52 2001
| +++ src/bison.simple Wed Jul 18 18:06:16 2001
| @@ -672,8 +672,8 @@
| count = 0;
| /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
| for (x = (yyn < 0 ? -yyn : 0);
| - x < (int) (sizeof (yytname) / sizeof (char *)); x++)
| - if (yycheck[x + yyn] == x)
| + x < (sizeof (yytname) / sizeof (char *)); x++)
| + if ((int) yycheck[x + yyn] == x)
| size += strlen (yytname[x]) + 15, count++;
| size += strlen ("parse error, unexpected `") + 1;
| size += strlen (yytname[YYTRANSLATE (yychar)]);
| @@ -688,8 +688,8 @@
| {
| count = 0;
| for (x = (yyn < 0 ? -yyn : 0);
| - x < (int) (sizeof (yytname) / sizeof (char *)); x++)
| - if (yycheck[x + yyn] == x)
| + x < (sizeof (yytname) / sizeof (char *)); x++)
| + if ((int) yycheck[x + yyn] == x)
| {
| strcat (msg, count == 0 ? ", expecting `" : " or `");
| strcat (msg, yytname[x]);
Huh? yycheck is composed of short, and x is int, so everything is
fine here (shorts are promoted to int). I don't understand the point
of your patch. I believe the current implementation is the right one.