                    Test case: usr.bin/yacc/legacy_test:main

     * Test program: /usr/tests/usr.bin/yacc/legacy_test
     * Result: failed: 15 tests of 15 failed
     * Duration: 0.210s
     * [1]Execution context

Metadata

     * allowed_architectures =
     * allowed_platforms =
     * description =
     * has_cleanup = false
     * required_configs =
     * required_disk_space = 0
     * required_files =
     * required_memory = 0
     * required_programs =
     * required_user =
     * timeout = 300

Standard output

1..15
--- /usr/tests/usr.bin/yacc/regress.00.out      2014-12-02 08:00:18.000000000 +0
000
+++ -   2014-12-03 01:07:29.424876368 +0000
@@ -1,17 +1,17 @@
-#ifndef lint
-static const char yysccsid[] = "@(#)yaccpar    1.9 (Berkeley) 02/21/93";
-#endif
+/* original parser id follows */
+/* yysccsid[] = "@(#)yaccpar   1.9 (Berkeley) 02/21/93" */
+/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */

 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
-#define YYPATCH 20140101

 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
 #define yyerrok        (yyerrflag = 0)
 #define YYRECOVERING() (yyerrflag != 0)
-
+#define YYENOMEM       (-2)
+#define YYEOF          0
 #define YYPREFIX "yy"

 #define YYPURE 0
@@ -49,42 +49,50 @@
 extern int YYPARSE_DECL();

 #define YYERRCODE 256
-static const short yylhs[] = {                           -1,
+typedef short YYINT;
+static const YYINT yylhs[] = {                           -1,
     0,
 };
-static const short yylen[] = {                            2,
+static const YYINT yylen[] = {                            2,
     0,
 };
-static const short yydefred[] = {                         1,
+static const YYINT yydefred[] = {                         1,
     0,
 };
-static const short yydgoto[] = {                          1,
+static const YYINT yydgoto[] = {                          1,
 };
-static const short yysindex[] = {                         0,
+static const YYINT yysindex[] = {                         0,
     0,
 };
-static const short yyrindex[] = {                         0,
+static const YYINT yyrindex[] = {                         0,
     0,
 };
-static const short yygindex[] = {                         0,
+static const YYINT yygindex[] = {                         0,
 };
 #define YYTABLESIZE 0
-static const short yytable[] = {                          0,
+static const YYINT yytable[] = {                          0,
 };
-static const short yycheck[] = {                         -1,
+static const YYINT yycheck[] = {                         -1,
 };
 #define YYFINAL 1
 #ifndef YYDEBUG
 #define YYDEBUG 0
 #endif
-#define YYMAXTOKEN 0
-#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
-#if YYDEBUG
-static const char *yyname[] = {
-
-"end-of-file","illegal-symbol",
+#define YYMAXTOKEN 256
+#define YYUNDFTOKEN 259
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
+#if YYDEBUG
+static const char *const yyname[] = {
+
+"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"illegal-symbol",
 };
-static const char *yyrule[] = {
+static const char *const yyrule[] = {
 "$accept : rule",
 "rule :",

@@ -116,9 +124,9 @@

 typedef struct {
     unsigned stacksize;
-    short    *s_base;
-    short    *s_mark;
-    short    *s_last;
+    YYINT    *s_base;
+    YYINT    *s_mark;
+    YYINT    *s_last;
     YYSTYPE  *l_base;
     YYSTYPE  *l_mark;
 } YYSTACKDATA;
@@ -137,27 +145,27 @@
 {
     int i;
     unsigned newsize;
-    short *newss;
+    YYINT *newss;
     YYSTYPE *newvs;

     if ((newsize = data->stacksize) == 0)
         newsize = YYINITSTACKSIZE;
     else if (newsize >= YYMAXDEPTH)
-        return -1;
+        return YYENOMEM;
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;

     i = (int) (data->s_mark - data->s_base);
-    newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
+    newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
-        return -1;
+        return YYENOMEM;

     data->s_base = newss;
     data->s_mark = newss + i;

     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
     if (newvs == 0)
-        return -1;
+        return YYENOMEM;

     data->l_base = newvs;
     data->l_mark = newvs + i;
@@ -207,7 +215,7 @@
     memset(&yystack, 0, sizeof(yystack));
 #endif

-    if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
+    if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyove
rflow;
     yystack.s_mark = yystack.s_base;
     yystack.l_mark = yystack.l_base;
     yystate = 0;
@@ -217,7 +225,7 @@
     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
     if (yychar < 0)
     {
-        if ((yychar = YYLEX) < 0) yychar = 0;
+        if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
         if (yydebug)
         {
@@ -235,7 +243,7 @@
             printf("%sdebug: state %d, shifting to state %d\n",
                     YYPREFIX, yystate, yytable[yyn]);
 #endif
-        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOM
EM)
         {
             goto yyoverflow;
         }
@@ -254,7 +262,7 @@
     }
     if (yyerrflag) goto yyinrecovery;

-    yyerror("syntax error");
+    YYERROR_CALL("syntax error");

     goto yyerrlab;

@@ -275,7 +283,7 @@
                     printf("%sdebug: state %d, error recovery shifting\
  to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
 #endif
-                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) =
= YYENOMEM)
                 {
                     goto yyoverflow;
                 }
@@ -299,7 +307,7 @@
     }
     else
     {
-        if (yychar == 0) goto yyabort;
+        if (yychar == YYEOF) goto yyabort;
 #if YYDEBUG
         if (yydebug)
         {
@@ -342,7 +350,7 @@
         *++yystack.l_mark = yyval;
         if (yychar < 0)
         {
-            if ((yychar = YYLEX) < 0) yychar = 0;
+            if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
             if (yydebug)
             {
@@ -352,7 +360,7 @@
             }
 #endif
         }
-        if (yychar == 0) goto yyaccept;
+        if (yychar == YYEOF) goto yyaccept;
         goto yyloop;
     }
     if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
@@ -365,16 +373,16 @@
         printf("%sdebug: after reduction, shifting from state %d \
 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
 #endif
-    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
     {
         goto yyoverflow;
     }
-    *++yystack.s_mark = (short) yystate;
+    *++yystack.s_mark = (YYINT) yystate;
     *++yystack.l_mark = yyval;
     goto yyloop;

 yyoverflow:
-    yyerror("yacc stack overflow");
+    YYERROR_CALL("yacc stack overflow");

 yyabort:
     yyfreestack(&yystack);
not ok - 00 # Test failed: regression detected.  See above. (in .)
--- /usr/tests/usr.bin/yacc/regress.01.out      2014-12-02 08:00:18.000000000 +0
000
+++ -   2014-12-03 01:07:29.478502169 +0000
@@ -1,17 +1,17 @@
-#ifndef lint
-static const char yysccsid[] = "@(#)yaccpar    1.9 (Berkeley) 02/21/93";
-#endif
+/* original parser id follows */
+/* yysccsid[] = "@(#)yaccpar   1.9 (Berkeley) 02/21/93" */
+/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */

 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
-#define YYPATCH 20140101

 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
 #define yyerrok        (yyerrflag = 0)
 #define YYRECOVERING() (yyerrflag != 0)
-
+#define YYENOMEM       (-2)
+#define YYEOF          0
 #define YYPREFIX "yy"

 #define YYPURE 0
@@ -26,10 +26,12 @@
 extern int yylex(void);
 static void yyerror(const char *s);

-#line 29 "/dev/stdout"
+#line 30 "/dev/stdout"

-#ifndef YYSTYPE
+#if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
+/* Default: YYSTYPE is the semantic value type. */
 typedef int YYSTYPE;
+# define YYSTYPE_IS_DECLARED 1
 #endif

 /* compatibility with bison */
@@ -67,40 +69,41 @@
 #define LETTER 258
 #define UMINUS 259
 #define YYERRCODE 256
-static const short yylhs[] = {                           -1,
+typedef short YYINT;
+static const YYINT yylhs[] = {                           -1,
     0,    0,    0,    1,    1,    2,    2,    2,    2,    2,
     2,    2,    2,    2,    2,    2,    3,    3,
 };
-static const short yylen[] = {                            2,
+static const YYINT yylen[] = {                            2,
     0,    3,    3,    1,    3,    3,    3,    3,    3,    3,
     3,    3,    3,    2,    1,    1,    1,    2,
 };
-static const short yydefred[] = {                         1,
+static const YYINT yydefred[] = {                         1,
     0,    0,   17,    0,    0,    0,    0,    0,    0,    3,
     0,   15,   14,    0,    2,    0,    0,    0,    0,    0,
     0,    0,   18,    0,    6,    0,    0,    0,    0,    9,
    10,   11,
 };
-static const short yydgoto[] = {                          1,
+static const YYINT yydgoto[] = {                          1,
     7,    8,    9,
 };
-static const short yysindex[] = {                         0,
+static const YYINT yysindex[] = {                         0,
   -40,   -7,    0,  -55,  -38,  -38,    1,  -29, -247,    0,
   -38,    0,    0,   22,    0,  -38,  -38,  -38,  -38,  -38,
   -38,  -38,    0,  -29,    0,   51,   60,  -20,  -20,    0,
     0,    0,
 };
-static const short yyrindex[] = {                         0,
+static const YYINT yyrindex[] = {                         0,
     0,    0,    0,    2,    0,    0,    0,    9,   -9,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,   10,    0,   -6,   14,    5,   13,    0,
     0,    0,
 };
-static const short yygindex[] = {                         0,
+static const YYINT yygindex[] = {                         0,
     0,   65,    0,
 };
 #define YYTABLESIZE 220
-static const short yytable[] = {                          6,
+static const YYINT yytable[] = {                          6,
    16,    6,   10,   13,    5,   11,    5,   22,   17,   23,
    15,   15,   20,   18,    7,   19,   22,   21,    4,    5,
     0,   20,    8,   12,    0,    0,   21,   16,   16,    0,
@@ -124,7 +127,7 @@
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    2,    3,    4,    3,   12,
 };
-static const short yycheck[] = {                         40,
+static const YYINT yycheck[] = {                         40,
    10,   40,   10,   10,   45,   61,   45,   37,   38,  257,
    10,   10,   42,   43,   10,   45,   37,   47,   10,   10,
    -1,   42,   10,   10,   -1,   -1,   47,   37,   38,   -1,
@@ -153,9 +156,10 @@
 #define YYDEBUG 0
 #endif
 #define YYMAXTOKEN 259
-#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
+#define YYUNDFTOKEN 265
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
 #if YYDEBUG
-static const char *yyname[] = {
+static const char *const yyname[] = {

 "end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0
,
@@ -164,9 +168,9 @@
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
-0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol",
+0,0,0,0,0,0,"DIGIT","LETTER","UMINUS",0,0,0,0,0,"illegal-symbol",
 };
-static const char *yyrule[] = {
+static const char *const yyrule[] = {
 "$accept : list",
 "list :",
 "list : list stat '\\n'",
@@ -215,9 +219,9 @@

 typedef struct {
     unsigned stacksize;
-    short    *s_base;
-    short    *s_mark;
-    short    *s_last;
+    YYINT    *s_base;
+    YYINT    *s_mark;
+    YYINT    *s_last;
     YYSTYPE  *l_base;
     YYSTYPE  *l_mark;
 } YYSTACKDATA;
@@ -265,7 +269,7 @@
     }
     return( c );
 }
-#line 267 "/dev/stdout"
+#line 273 "/dev/stdout"

 #if YYDEBUG
 #include               /* needed for printf */
@@ -279,27 +283,27 @@
 {
     int i;
     unsigned newsize;
-    short *newss;
+    YYINT *newss;
     YYSTYPE *newvs;

     if ((newsize = data->stacksize) == 0)
         newsize = YYINITSTACKSIZE;
     else if (newsize >= YYMAXDEPTH)
-        return -1;
+        return YYENOMEM;
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;

     i = (int) (data->s_mark - data->s_base);
-    newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
+    newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
-        return -1;
+        return YYENOMEM;

     data->s_base = newss;
     data->s_mark = newss + i;

     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
     if (newvs == 0)
-        return -1;
+        return YYENOMEM;

     data->l_base = newvs;
     data->l_mark = newvs + i;
@@ -349,7 +353,7 @@
     memset(&yystack, 0, sizeof(yystack));
 #endif

-    if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
+    if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyove
rflow;
     yystack.s_mark = yystack.s_base;
     yystack.l_mark = yystack.l_base;
     yystate = 0;
@@ -359,7 +363,7 @@
     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
     if (yychar < 0)
     {
-        if ((yychar = YYLEX) < 0) yychar = 0;
+        if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
         if (yydebug)
         {
@@ -377,7 +381,7 @@
             printf("%sdebug: state %d, shifting to state %d\n",
                     YYPREFIX, yystate, yytable[yyn]);
 #endif
-        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOM
EM)
         {
             goto yyoverflow;
         }
@@ -396,7 +400,7 @@
     }
     if (yyerrflag) goto yyinrecovery;

-    yyerror("syntax error");
+    YYERROR_CALL("syntax error");

     goto yyerrlab;

@@ -417,7 +421,7 @@
                     printf("%sdebug: state %d, error recovery shifting\
  to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
 #endif
-                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) =
= YYENOMEM)
                 {
                     goto yyoverflow;
                 }
@@ -441,7 +445,7 @@
     }
     else
     {
-        if (yychar == 0) goto yyabort;
+        if (yychar == YYEOF) goto yyabort;
 #if YYDEBUG
         if (yydebug)
         {
@@ -527,7 +531,7 @@
 #line 63 "calc.y"
        {  yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
 break;
-#line 529 "/dev/stdout"
+#line 535 "/dev/stdout"
     }
     yystack.s_mark -= yym;
     yystate = *yystack.s_mark;
@@ -545,7 +549,7 @@
         *++yystack.l_mark = yyval;
         if (yychar < 0)
         {
-            if ((yychar = YYLEX) < 0) yychar = 0;
+            if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
             if (yydebug)
             {
@@ -555,7 +559,7 @@
             }
 #endif
         }
-        if (yychar == 0) goto yyaccept;
+        if (yychar == YYEOF) goto yyaccept;
         goto yyloop;
     }
     if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
@@ -568,16 +572,16 @@
         printf("%sdebug: after reduction, shifting from state %d \
 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
 #endif
-    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
     {
         goto yyoverflow;
     }
-    *++yystack.s_mark = (short) yystate;
+    *++yystack.s_mark = (YYINT) yystate;
     *++yystack.l_mark = yyval;
     goto yyloop;

 yyoverflow:
-    yyerror("yacc stack overflow");
+    YYERROR_CALL("yacc stack overflow");

 yyabort:
     yyfreestack(&yystack);
not ok - 01 # Test failed: regression detected.  See above. (in .)
--- /usr/tests/usr.bin/yacc/regress.02.out      2014-12-02 08:00:18.000000000 +0
000
+++ -   2014-12-03 01:07:29.484502968 +0000
@@ -1,17 +1,17 @@
-#ifndef lint
-static const char yysccsid[] = "@(#)yaccpar    1.9 (Berkeley) 02/21/93";
-#endif
+/* original parser id follows */
+/* yysccsid[] = "@(#)yaccpar   1.9 (Berkeley) 02/21/93" */
+/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */

 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
-#define YYPATCH 20140101

 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
 #define yyerrok        (yyerrflag = 0)
 #define YYRECOVERING() (yyerrflag != 0)
-
+#define YYENOMEM       (-2)
+#define YYEOF          0
 #define YYPREFIX "yy"

 #define YYPURE 0
@@ -56,7 +56,7 @@
        INTERVAL vval;
 } YYSTYPE;
 #endif /* !YYSTYPE_IS_DECLARED */
-#line 59 "/dev/stdout"
+#line 60 "/dev/stdout"

 /* compatibility with bison */
 #ifdef YYPARSE_PARAM
@@ -94,17 +94,18 @@
 #define CONST 259
 #define UMINUS 260
 #define YYERRCODE 256
-static const short yylhs[] = {                           -1,
+typedef short YYINT;
+static const YYINT yylhs[] = {                           -1,
     3,    3,    0,    0,    0,    0,    0,    1,    1,    1,
     1,    1,    1,    1,    1,    2,    2,    2,    2,    2,
     2,    2,    2,    2,    2,    2,    2,    2,
 };
-static const short yylen[] = {                            2,
+static const YYINT yylen[] = {                            2,
     0,    2,    2,    2,    4,    4,    2,    1,    1,    3,
     3,    3,    3,    2,    3,    1,    5,    1,    3,    3,
     3,    3,    3,    3,    3,    3,    2,    3,
 };
-static const short yydefred[] = {                         0,
+static const YYINT yydefred[] = {                         0,
     0,    0,    0,    8,    0,    0,    0,    0,    0,    7,
     0,    0,    9,   18,   14,   27,    0,    0,    0,    0,
     0,    0,    3,    0,    0,    0,    0,    4,    0,    0,
@@ -113,10 +114,10 @@
     0,    0,    0,    0,    5,    6,    0,    0,    0,   12,
    13,   17,
 };
-static const short yydgoto[] = {                          7,
+static const YYINT yydgoto[] = {                          7,
    32,    9,    0,
 };
-static const short yysindex[] = {                       -40,
+static const YYINT yysindex[] = {                       -40,
    -8,  -48,  -47,    0,  -37,  -37,    0,    2,   17,    0,
   -34,  -37,    0,    0,    0,    0,  -25,   90,  -37,  -37,
   -37,  -37,    0,  -37,  -37,  -37,  -37,    0,  -34,  -34,
@@ -125,7 +126,7 @@
   -34,  -34,  -34,  -34,    0,    0,  118,   69,   69,    0,
     0,    0,
 };
-static const short yyrindex[] = {                         0,
+static const YYINT yyrindex[] = {                         0,
     0,   38,   44,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
@@ -134,11 +135,11 @@
     0,    0,    0,    0,    0,    0,    0,   78,   83,    0,
     0,    0,
 };
-static const short yygindex[] = {                         0,
+static const YYINT yygindex[] = {                         0,
     4,  124,    0,
 };
 #define YYTABLESIZE 225
-static const short yytable[] = {                          6,
+static const YYINT yytable[] = {                          6,
    16,   10,    6,    8,    5,   30,   20,    5,   15,   17,
    29,   23,   11,   12,   31,   34,   21,   19,   35,   20,
     0,   22,   37,   39,   41,   43,   28,    0,    0,    0,
@@ -163,7 +164,7 @@
     0,    0,    0,    0,    0,    1,    2,    3,    4,   13,
    14,    4,   13,    0,    4,
 };
-static const short yycheck[] = {                         40,
+static const YYINT yycheck[] = {                         40,
    10,   10,   40,    0,   45,   40,   10,   45,    5,    6,
    45,   10,   61,   61,   11,   41,   42,   43,   44,   45,
    -1,   47,   19,   20,   21,   22,   10,   -1,   -1,   -1,
@@ -193,9 +194,10 @@
 #define YYDEBUG 0
 #endif
 #define YYMAXTOKEN 260
-#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
+#define YYUNDFTOKEN 266
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
 #if YYDEBUG
-static const char *yyname[] = {
+static const char *const yyname[] = {

 "end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,0,0,0,"'('","')'","'*'","'+'","','","'-'",0,"'/'",0,0,0,0,0,0,0,0,0
,
@@ -204,9 +206,9 @@
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
-0,0,"DREG","VREG","CONST","UMINUS","illegal-symbol",
+0,0,"DREG","VREG","CONST","UMINUS",0,0,0,0,0,"illegal-symbol",
 };
-static const char *yyrule[] = {
+static const char *const yyrule[] = {
 "$accept : line",
 "lines :",
 "lines : lines line",
@@ -265,9 +267,9 @@

 typedef struct {
     unsigned stacksize;
-    short    *s_base;
-    short    *s_mark;
-    short    *s_last;
+    YYINT    *s_base;
+    YYINT    *s_mark;
+    YYINT    *s_last;
     YYSTYPE  *l_base;
     YYSTYPE  *l_mark;
 } YYSTACKDATA;
@@ -404,7 +406,7 @@
 {
     return (hilo(a / v.hi, a / v.lo, b / v.hi, b / v.lo));
 }
-#line 406 "/dev/stdout"
+#line 410 "/dev/stdout"

 #if YYDEBUG
 #include               /* needed for printf */
@@ -418,27 +420,27 @@
 {
     int i;
     unsigned newsize;
-    short *newss;
+    YYINT *newss;
     YYSTYPE *newvs;

     if ((newsize = data->stacksize) == 0)
         newsize = YYINITSTACKSIZE;
     else if (newsize >= YYMAXDEPTH)
-        return -1;
+        return YYENOMEM;
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;

     i = (int) (data->s_mark - data->s_base);
-    newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
+    newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
-        return -1;
+        return YYENOMEM;

     data->s_base = newss;
     data->s_mark = newss + i;

     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
     if (newvs == 0)
-        return -1;
+        return YYENOMEM;

     data->l_base = newvs;
     data->l_mark = newvs + i;
@@ -488,7 +490,7 @@
     memset(&yystack, 0, sizeof(yystack));
 #endif

-    if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
+    if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyove
rflow;
     yystack.s_mark = yystack.s_base;
     yystack.l_mark = yystack.l_base;
     yystate = 0;
@@ -498,7 +500,7 @@
     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
     if (yychar < 0)
     {
-        if ((yychar = YYLEX) < 0) yychar = 0;
+        if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
         if (yydebug)
         {
@@ -516,7 +518,7 @@
             printf("%sdebug: state %d, shifting to state %d\n",
                     YYPREFIX, yystate, yytable[yyn]);
 #endif
-        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOM
EM)
         {
             goto yyoverflow;
         }
@@ -535,7 +537,7 @@
     }
     if (yyerrflag) goto yyinrecovery;

-    yyerror("syntax error");
+    YYERROR_CALL("syntax error");

     goto yyerrlab;

@@ -556,7 +558,7 @@
                     printf("%sdebug: state %d, error recovery shifting\
  to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
 #endif
-                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) =
= YYENOMEM)
                 {
                     goto yyoverflow;
                 }
@@ -580,7 +582,7 @@
     }
     else
     {
-        if (yychar == 0) goto yyabort;
+        if (yychar == YYEOF) goto yyabort;
 #if YYDEBUG
         if (yydebug)
         {
@@ -769,7 +771,7 @@
                yyval.vval = yystack.l_mark[-1].vval;
        }
 break;
-#line 771 "/dev/stdout"
+#line 775 "/dev/stdout"
     }
     yystack.s_mark -= yym;
     yystate = *yystack.s_mark;
@@ -787,7 +789,7 @@
         *++yystack.l_mark = yyval;
         if (yychar < 0)
         {
-            if ((yychar = YYLEX) < 0) yychar = 0;
+            if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
             if (yydebug)
             {
@@ -797,7 +799,7 @@
             }
 #endif
         }
-        if (yychar == 0) goto yyaccept;
+        if (yychar == YYEOF) goto yyaccept;
         goto yyloop;
     }
     if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
@@ -810,16 +812,16 @@
         printf("%sdebug: after reduction, shifting from state %d \
 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
 #endif
-    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
     {
         goto yyoverflow;
     }
-    *++yystack.s_mark = (short) yystate;
+    *++yystack.s_mark = (YYINT) yystate;
     *++yystack.l_mark = yyval;
     goto yyloop;

 yyoverflow:
-    yyerror("yacc stack overflow");
+    YYERROR_CALL("yacc stack overflow");

 yyabort:
     yyfreestack(&yystack);
not ok - 02 # Test failed: regression detected.  See above. (in .)
--- /usr/tests/usr.bin/yacc/regress.03.out      2014-12-02 08:00:18.000000000 +0
000
+++ -   2014-12-03 01:07:29.498539468 +0000
@@ -1,17 +1,17 @@
-#ifndef lint
-static const char yysccsid[] = "@(#)yaccpar    1.9 (Berkeley) 02/21/93";
-#endif
+/* original parser id follows */
+/* yysccsid[] = "@(#)yaccpar   1.9 (Berkeley) 02/21/93" */
+/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */

 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
-#define YYPATCH 20140101

 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
 #define yyerrok        (yyerrflag = 0)
 #define YYRECOVERING() (yyerrflag != 0)
-
+#define YYENOMEM       (-2)
+#define YYEOF          0
 #define YYPREFIX "yy"

 #define YYPURE 1
@@ -29,10 +29,12 @@
 static void YYERROR_DECL();
 #endif

-#line 32 "/dev/stdout"
+#line 33 "/dev/stdout"

-#ifndef YYSTYPE
+#if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
+/* Default: YYSTYPE is the semantic value type. */
 typedef int YYSTYPE;
+# define YYSTYPE_IS_DECLARED 1
 #endif

 /* compatibility with bison */
@@ -74,40 +76,41 @@
 #define LETTER 258
 #define UMINUS 259
 #define YYERRCODE 256
-static const short yylhs[] = {                           -1,
+typedef short YYINT;
+static const YYINT yylhs[] = {                           -1,
     0,    0,    0,    1,    1,    2,    2,    2,    2,    2,
     2,    2,    2,    2,    2,    2,    3,    3,
 };
-static const short yylen[] = {                            2,
+static const YYINT yylen[] = {                            2,
     0,    3,    3,    1,    3,    3,    3,    3,    3,    3,
     3,    3,    3,    2,    1,    1,    1,    2,
 };
-static const short yydefred[] = {                         1,
+static const YYINT yydefred[] = {                         1,
     0,    0,   17,    0,    0,    0,    0,    0,    0,    3,
     0,   15,   14,    0,    2,    0,    0,    0,    0,    0,
     0,    0,   18,    0,    6,    0,    0,    0,    0,    9,
    10,   11,
 };
-static const short yydgoto[] = {                          1,
+static const YYINT yydgoto[] = {                          1,
     7,    8,    9,
 };
-static const short yysindex[] = {                         0,
+static const YYINT yysindex[] = {                         0,
   -40,   -7,    0,  -55,  -38,  -38,    1,  -29, -247,    0,
   -38,    0,    0,   22,    0,  -38,  -38,  -38,  -38,  -38,
   -38,  -38,    0,  -29,    0,   51,   60,  -20,  -20,    0,
     0,    0,
 };
-static const short yyrindex[] = {                         0,
+static const YYINT yyrindex[] = {                         0,
     0,    0,    0,    2,    0,    0,    0,    9,   -9,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,   10,    0,   -6,   14,    5,   13,    0,
     0,    0,
 };
-static const short yygindex[] = {                         0,
+static const YYINT yygindex[] = {                         0,
     0,   65,    0,
 };
 #define YYTABLESIZE 220
-static const short yytable[] = {                          6,
+static const YYINT yytable[] = {                          6,
    16,    6,   10,   13,    5,   11,    5,   22,   17,   23,
    15,   15,   20,   18,    7,   19,   22,   21,    4,    5,
     0,   20,    8,   12,    0,    0,   21,   16,   16,    0,
@@ -131,7 +134,7 @@
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    2,    3,    4,    3,   12,
 };
-static const short yycheck[] = {                         40,
+static const YYINT yycheck[] = {                         40,
    10,   40,   10,   10,   45,   61,   45,   37,   38,  257,
    10,   10,   42,   43,   10,   45,   37,   47,   10,   10,
    -1,   42,   10,   10,   -1,   -1,   47,   37,   38,   -1,
@@ -160,9 +163,10 @@
 #define YYDEBUG 0
 #endif
 #define YYMAXTOKEN 259
-#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
+#define YYUNDFTOKEN 265
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
 #if YYDEBUG
-static const char *yyname[] = {
+static const char *const yyname[] = {

 "end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0
,
@@ -171,9 +175,9 @@
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
-0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol",
+0,0,0,0,0,0,"DIGIT","LETTER","UMINUS",0,0,0,0,0,"illegal-symbol",
 };
-static const char *yyrule[] = {
+static const char *const yyrule[] = {
 "$accept : list",
 "list :",
 "list : list stat '\\n'",
@@ -217,9 +221,9 @@

 typedef struct {
     unsigned stacksize;
-    short    *s_base;
-    short    *s_mark;
-    short    *s_last;
+    YYINT    *s_base;
+    YYINT    *s_mark;
+    YYINT    *s_last;
     YYSTYPE  *l_base;
     YYSTYPE  *l_mark;
 } YYSTACKDATA;
@@ -272,7 +276,7 @@
     }
     return( c );
 }
-#line 274 "/dev/stdout"
+#line 280 "/dev/stdout"

 #if YYDEBUG
 #include               /* needed for printf */
@@ -286,27 +290,27 @@
 {
     int i;
     unsigned newsize;
-    short *newss;
+    YYINT *newss;
     YYSTYPE *newvs;

     if ((newsize = data->stacksize) == 0)
         newsize = YYINITSTACKSIZE;
     else if (newsize >= YYMAXDEPTH)
-        return -1;
+        return YYENOMEM;
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;

     i = (int) (data->s_mark - data->s_base);
-    newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
+    newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
-        return -1;
+        return YYENOMEM;

     data->s_base = newss;
     data->s_mark = newss + i;

     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
     if (newvs == 0)
-        return -1;
+        return YYENOMEM;

     data->l_base = newvs;
     data->l_mark = newvs + i;
@@ -363,7 +367,7 @@
     memset(&yystack, 0, sizeof(yystack));
 #endif

-    if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
+    if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyove
rflow;
     yystack.s_mark = yystack.s_base;
     yystack.l_mark = yystack.l_base;
     yystate = 0;
@@ -373,7 +377,7 @@
     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
     if (yychar < 0)
     {
-        if ((yychar = YYLEX) < 0) yychar = 0;
+        if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
         if (yydebug)
         {
@@ -391,7 +395,7 @@
             printf("%sdebug: state %d, shifting to state %d\n",
                     YYPREFIX, yystate, yytable[yyn]);
 #endif
-        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOM
EM)
         {
             goto yyoverflow;
         }
@@ -410,7 +414,7 @@
     }
     if (yyerrflag) goto yyinrecovery;

-    yyerror(regs, base, "syntax error");
+    YYERROR_CALL("syntax error");

     goto yyerrlab;

@@ -431,7 +435,7 @@
                     printf("%sdebug: state %d, error recovery shifting\
  to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
 #endif
-                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) =
= YYENOMEM)
                 {
                     goto yyoverflow;
                 }
@@ -455,7 +459,7 @@
     }
     else
     {
-        if (yychar == 0) goto yyabort;
+        if (yychar == YYEOF) goto yyabort;
 #if YYDEBUG
         if (yydebug)
         {
@@ -541,7 +545,7 @@
 #line 73 "calc3.y"
        {  yyval = (*base) * yystack.l_mark[-1] + yystack.l_mark[0]; }
 break;
-#line 543 "/dev/stdout"
+#line 549 "/dev/stdout"
     }
     yystack.s_mark -= yym;
     yystate = *yystack.s_mark;
@@ -559,7 +563,7 @@
         *++yystack.l_mark = yyval;
         if (yychar < 0)
         {
-            if ((yychar = YYLEX) < 0) yychar = 0;
+            if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
             if (yydebug)
             {
@@ -569,7 +573,7 @@
             }
 #endif
         }
-        if (yychar == 0) goto yyaccept;
+        if (yychar == YYEOF) goto yyaccept;
         goto yyloop;
     }
     if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
@@ -582,16 +586,16 @@
         printf("%sdebug: after reduction, shifting from state %d \
 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
 #endif
-    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
     {
         goto yyoverflow;
     }
-    *++yystack.s_mark = (short) yystate;
+    *++yystack.s_mark = (YYINT) yystate;
     *++yystack.l_mark = yyval;
     goto yyloop;

 yyoverflow:
-    yyerror(regs, base, "yacc stack overflow");
+    YYERROR_CALL("yacc stack overflow");

 yyabort:
     yyfreestack(&yystack);
not ok - 03 # Test failed: regression detected.  See above. (in .)
--- /usr/tests/usr.bin/yacc/regress.04.out      2014-12-02 08:00:18.000000000 +0
000
+++ -   2014-12-03 01:07:29.507995968 +0000
@@ -1,17 +1,17 @@
-#ifndef lint
-static const char yysccsid[] = "@(#)yaccpar    1.9 (Berkeley) 02/21/93";
-#endif
+/* original parser id follows */
+/* yysccsid[] = "@(#)yaccpar   1.9 (Berkeley) 02/21/93" */
+/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */

 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
-#define YYPATCH 20140101

 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
 #define yyerrok        (yyerrflag = 0)
 #define YYRECOVERING() (yyerrflag != 0)
-
+#define YYENOMEM       (-2)
+#define YYEOF          0
 #define YYPREFIX "yy"

 #define YYPURE 0
@@ -28,10 +28,12 @@
 static void yyerror(const char *s);
 #endif

-#line 31 "/dev/stdout"
+#line 32 "/dev/stdout"

-#ifndef YYSTYPE
+#if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
+/* Default: YYSTYPE is the semantic value type. */
 typedef int YYSTYPE;
+# define YYSTYPE_IS_DECLARED 1
 #endif

 /* compatibility with bison */
@@ -69,40 +71,41 @@
 #define LETTER 258
 #define UMINUS 259
 #define YYERRCODE 256
-static const short yylhs[] = {                           -1,
+typedef short YYINT;
+static const YYINT yylhs[] = {                           -1,
     0,    0,    0,    1,    1,    2,    2,    2,    2,    2,
     2,    2,    2,    2,    2,    2,    3,    3,
 };
-static const short yylen[] = {                            2,
+static const YYINT yylen[] = {                            2,
     0,    3,    3,    1,    3,    3,    3,    3,    3,    3,
     3,    3,    3,    2,    1,    1,    1,    2,
 };
-static const short yydefred[] = {                         1,
+static const YYINT yydefred[] = {                         1,
     0,    0,   17,    0,    0,    0,    0,    0,    0,    3,
     0,   15,   14,    0,    2,    0,    0,    0,    0,    0,
     0,    0,   18,    0,    6,    0,    0,    0,    0,    9,
    10,   11,
 };
-static const short yydgoto[] = {                          1,
+static const YYINT yydgoto[] = {                          1,
     7,    8,    9,
 };
-static const short yysindex[] = {                         0,
+static const YYINT yysindex[] = {                         0,
   -40,   -7,    0,  -55,  -38,  -38,    1,  -29, -247,    0,
   -38,    0,    0,   22,    0,  -38,  -38,  -38,  -38,  -38,
   -38,  -38,    0,  -29,    0,   51,   60,  -20,  -20,    0,
     0,    0,
 };
-static const short yyrindex[] = {                         0,
+static const YYINT yyrindex[] = {                         0,
     0,    0,    0,    2,    0,    0,    0,    9,   -9,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,   10,    0,   -6,   14,    5,   13,    0,
     0,    0,
 };
-static const short yygindex[] = {                         0,
+static const YYINT yygindex[] = {                         0,
     0,   65,    0,
 };
 #define YYTABLESIZE 220
-static const short yytable[] = {                          6,
+static const YYINT yytable[] = {                          6,
    16,    6,   10,   13,    5,   11,    5,   22,   17,   23,
    15,   15,   20,   18,    7,   19,   22,   21,    4,    5,
     0,   20,    8,   12,    0,    0,   21,   16,   16,    0,
@@ -126,7 +129,7 @@
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    2,    3,    4,    3,   12,
 };
-static const short yycheck[] = {                         40,
+static const YYINT yycheck[] = {                         40,
    10,   40,   10,   10,   45,   61,   45,   37,   38,  257,
    10,   10,   42,   43,   10,   45,   37,   47,   10,   10,
    -1,   42,   10,   10,   -1,   -1,   47,   37,   38,   -1,
@@ -155,9 +158,10 @@
 #define YYDEBUG 0
 #endif
 #define YYMAXTOKEN 259
-#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
+#define YYUNDFTOKEN 265
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
 #if YYDEBUG
-static const char *yyname[] = {
+static const char *const yyname[] = {

 "end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0
,
@@ -166,9 +170,9 @@
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
-0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol",
+0,0,0,0,0,0,"DIGIT","LETTER","UMINUS",0,0,0,0,0,"illegal-symbol",
 };
-static const char *yyrule[] = {
+static const char *const yyrule[] = {
 "$accept : list",
 "list :",
 "list : list stat '\\n'",
@@ -217,9 +221,9 @@

 typedef struct {
     unsigned stacksize;
-    short    *s_base;
-    short    *s_mark;
-    short    *s_last;
+    YYINT    *s_base;
+    YYINT    *s_mark;
+    YYINT    *s_last;
     YYSTYPE  *l_base;
     YYSTYPE  *l_mark;
 } YYSTACKDATA;
@@ -271,7 +275,7 @@
     }
     return( c );
 }
-#line 273 "/dev/stdout"
+#line 279 "/dev/stdout"

 #if YYDEBUG
 #include               /* needed for printf */
@@ -285,27 +289,27 @@
 {
     int i;
     unsigned newsize;
-    short *newss;
+    YYINT *newss;
     YYSTYPE *newvs;

     if ((newsize = data->stacksize) == 0)
         newsize = YYINITSTACKSIZE;
     else if (newsize >= YYMAXDEPTH)
-        return -1;
+        return YYENOMEM;
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;

     i = (int) (data->s_mark - data->s_base);
-    newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
+    newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
-        return -1;
+        return YYENOMEM;

     data->s_base = newss;
     data->s_mark = newss + i;

     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
     if (newvs == 0)
-        return -1;
+        return YYENOMEM;

     data->l_base = newvs;
     data->l_mark = newvs + i;
@@ -355,7 +359,7 @@
     memset(&yystack, 0, sizeof(yystack));
 #endif

-    if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
+    if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyove
rflow;
     yystack.s_mark = yystack.s_base;
     yystack.l_mark = yystack.l_base;
     yystate = 0;
@@ -365,7 +369,7 @@
     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
     if (yychar < 0)
     {
-        if ((yychar = YYLEX) < 0) yychar = 0;
+        if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
         if (yydebug)
         {
@@ -383,7 +387,7 @@
             printf("%sdebug: state %d, shifting to state %d\n",
                     YYPREFIX, yystate, yytable[yyn]);
 #endif
-        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOM
EM)
         {
             goto yyoverflow;
         }
@@ -402,7 +406,7 @@
     }
     if (yyerrflag) goto yyinrecovery;

-    yyerror("syntax error");
+    YYERROR_CALL("syntax error");

     goto yyerrlab;

@@ -423,7 +427,7 @@
                     printf("%sdebug: state %d, error recovery shifting\
  to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
 #endif
-                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) =
= YYENOMEM)
                 {
                     goto yyoverflow;
                 }
@@ -447,7 +451,7 @@
     }
     else
     {
-        if (yychar == 0) goto yyabort;
+        if (yychar == YYEOF) goto yyabort;
 #if YYDEBUG
         if (yydebug)
         {
@@ -533,7 +537,7 @@
 #line 65 "code_calc.y"
        {  yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
 break;
-#line 535 "/dev/stdout"
+#line 541 "/dev/stdout"
     }
     yystack.s_mark -= yym;
     yystate = *yystack.s_mark;
@@ -551,7 +555,7 @@
         *++yystack.l_mark = yyval;
         if (yychar < 0)
         {
-            if ((yychar = YYLEX) < 0) yychar = 0;
+            if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
             if (yydebug)
             {
@@ -561,7 +565,7 @@
             }
 #endif
         }
-        if (yychar == 0) goto yyaccept;
+        if (yychar == YYEOF) goto yyaccept;
         goto yyloop;
     }
     if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
@@ -574,16 +578,16 @@
         printf("%sdebug: after reduction, shifting from state %d \
 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
 #endif
-    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
     {
         goto yyoverflow;
     }
-    *++yystack.s_mark = (short) yystate;
+    *++yystack.s_mark = (YYINT) yystate;
     *++yystack.l_mark = yyval;
     goto yyloop;

 yyoverflow:
-    yyerror("yacc stack overflow");
+    YYERROR_CALL("yacc stack overflow");

 yyabort:
     yyfreestack(&yystack);
not ok - 04 # Test failed: regression detected.  See above. (in .)
--- /usr/tests/usr.bin/yacc/regress.05.out      2014-12-02 08:00:18.000000000 +0
000
+++ -   2014-12-03 01:07:29.515025469 +0000
@@ -1,17 +1,17 @@
-#ifndef lint
-static const char yysccsid[] = "@(#)yaccpar    1.9 (Berkeley) 02/21/93";
-#endif
+/* original parser id follows */
+/* yysccsid[] = "@(#)yaccpar   1.9 (Berkeley) 02/21/93" */
+/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */

 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
-#define YYPATCH 20140101

 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
 #define yyerrok        (yyerrflag = 0)
 #define YYRECOVERING() (yyerrflag != 0)
-
+#define YYENOMEM       (-2)
+#define YYEOF          0
 #define YYPREFIX "yy"

 #define YYPURE 0
@@ -23,10 +23,12 @@
 static void yyerror(const char *);
 #endif

-#line 26 "/dev/stdout"
+#line 27 "/dev/stdout"

-#ifndef YYSTYPE
+#if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
+/* Default: YYSTYPE is the semantic value type. */
 typedef int YYSTYPE;
+# define YYSTYPE_IS_DECLARED 1
 #endif

 /* compatibility with bison */
@@ -61,42 +63,50 @@
 extern int YYPARSE_DECL();

 #define YYERRCODE 256
-static const short yylhs[] = {                           -1,
+typedef short YYINT;
+static const YYINT yylhs[] = {                           -1,
     0,
 };
-static const short yylen[] = {                            2,
+static const YYINT yylen[] = {                            2,
     1,
 };
-static const short yydefred[] = {                         0,
+static const YYINT yydefred[] = {                         0,
     1,    0,
 };
-static const short yydgoto[] = {                          2,
+static const YYINT yydgoto[] = {                          2,
 };
-static const short yysindex[] = {                      -256,
+static const YYINT yysindex[] = {                      -256,
     0,    0,
 };
-static const short yyrindex[] = {                         0,
+static const YYINT yyrindex[] = {                         0,
     0,    0,
 };
-static const short yygindex[] = {                         0,
+static const YYINT yygindex[] = {                         0,
 };
 #define YYTABLESIZE 0
-static const short yytable[] = {                          1,
+static const YYINT yytable[] = {                          1,
 };
-static const short yycheck[] = {                        256,
+static const YYINT yycheck[] = {                        256,
 };
 #define YYFINAL 2
 #ifndef YYDEBUG
 #define YYDEBUG 0
 #endif
-#define YYMAXTOKEN 0
-#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
-#if YYDEBUG
-static const char *yyname[] = {
-
-"end-of-file","illegal-symbol",
+#define YYMAXTOKEN 256
+#define YYUNDFTOKEN 259
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
+#if YYDEBUG
+static const char *const yyname[] = {
+
+"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"illegal-symbol",
 };
-static const char *yyrule[] = {
+static const char *const yyrule[] = {
 "$accept : S",
 "S : error",

@@ -128,9 +138,9 @@

 typedef struct {
     unsigned stacksize;
-    short    *s_base;
-    short    *s_mark;
-    short    *s_last;
+    YYINT    *s_base;
+    YYINT    *s_mark;
+    YYINT    *s_last;
     YYSTYPE  *l_base;
     YYSTYPE  *l_mark;
 } YYSTACKDATA;
@@ -162,7 +172,7 @@
 {
     printf("%s\n", s);
 }
-#line 164 "/dev/stdout"
+#line 176 "/dev/stdout"

 #if YYDEBUG
 #include               /* needed for printf */
@@ -176,27 +186,27 @@
 {
     int i;
     unsigned newsize;
-    short *newss;
+    YYINT *newss;
     YYSTYPE *newvs;

     if ((newsize = data->stacksize) == 0)
         newsize = YYINITSTACKSIZE;
     else if (newsize >= YYMAXDEPTH)
-        return -1;
+        return YYENOMEM;
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;

     i = (int) (data->s_mark - data->s_base);
-    newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
+    newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
-        return -1;
+        return YYENOMEM;

     data->s_base = newss;
     data->s_mark = newss + i;

     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
     if (newvs == 0)
-        return -1;
+        return YYENOMEM;

     data->l_base = newvs;
     data->l_mark = newvs + i;
@@ -246,7 +256,7 @@
     memset(&yystack, 0, sizeof(yystack));
 #endif

-    if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
+    if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyove
rflow;
     yystack.s_mark = yystack.s_base;
     yystack.l_mark = yystack.l_base;
     yystate = 0;
@@ -256,7 +266,7 @@
     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
     if (yychar < 0)
     {
-        if ((yychar = YYLEX) < 0) yychar = 0;
+        if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
         if (yydebug)
         {
@@ -274,7 +284,7 @@
             printf("%sdebug: state %d, shifting to state %d\n",
                     YYPREFIX, yystate, yytable[yyn]);
 #endif
-        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOM
EM)
         {
             goto yyoverflow;
         }
@@ -293,7 +303,7 @@
     }
     if (yyerrflag) goto yyinrecovery;

-    yyerror("syntax error");
+    YYERROR_CALL("syntax error");

     goto yyerrlab;

@@ -314,7 +324,7 @@
                     printf("%sdebug: state %d, error recovery shifting\
  to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
 #endif
-                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) =
= YYENOMEM)
                 {
                     goto yyoverflow;
                 }
@@ -338,7 +348,7 @@
     }
     else
     {
-        if (yychar == 0) goto yyabort;
+        if (yychar == YYEOF) goto yyabort;
 #if YYDEBUG
         if (yydebug)
         {
@@ -381,7 +391,7 @@
         *++yystack.l_mark = yyval;
         if (yychar < 0)
         {
-            if ((yychar = YYLEX) < 0) yychar = 0;
+            if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
             if (yydebug)
             {
@@ -391,7 +401,7 @@
             }
 #endif
         }
-        if (yychar == 0) goto yyaccept;
+        if (yychar == YYEOF) goto yyaccept;
         goto yyloop;
     }
     if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
@@ -404,16 +414,16 @@
         printf("%sdebug: after reduction, shifting from state %d \
 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
 #endif
-    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
     {
         goto yyoverflow;
     }
-    *++yystack.s_mark = (short) yystate;
+    *++yystack.s_mark = (YYINT) yystate;
     *++yystack.l_mark = yyval;
     goto yyloop;

 yyoverflow:
-    yyerror("yacc stack overflow");
+    YYERROR_CALL("yacc stack overflow");

 yyabort:
     yyfreestack(&yystack);
not ok - 05 # Test failed: regression detected.  See above. (in .)
--- /usr/tests/usr.bin/yacc/regress.06.out      2014-12-02 08:00:18.000000000 +0
000
+++ -   2014-12-03 01:07:29.526771568 +0000
@@ -1,17 +1,17 @@
-#ifndef lint
-static const char yysccsid[] = "@(#)yaccpar    1.9 (Berkeley) 02/21/93";
-#endif
+/* original parser id follows */
+/* yysccsid[] = "@(#)yaccpar   1.9 (Berkeley) 02/21/93" */
+/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */

 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
-#define YYPATCH 20140101

 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
 #define yyerrok        (yyerrflag = 0)
 #define YYRECOVERING() (yyerrflag != 0)
-
+#define YYENOMEM       (-2)
+#define YYEOF          0
 #define YYPREFIX "yy"

 #define YYPURE 0
@@ -19,10 +19,12 @@
 #line 2 "error.y"
 int yylex(void);
 static void yyerror(const char *);
-#line 22 "/dev/stdout"
+#line 23 "/dev/stdout"

-#ifndef YYSTYPE
+#if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
+/* Default: YYSTYPE is the semantic value type. */
 typedef int YYSTYPE;
+# define YYSTYPE_IS_DECLARED 1
 #endif

 /* compatibility with bison */
@@ -57,42 +59,50 @@
 extern int YYPARSE_DECL();

 #define YYERRCODE 256
-static const short yylhs[] = {                           -1,
+typedef short YYINT;
+static const YYINT yylhs[] = {                           -1,
     0,
 };
-static const short yylen[] = {                            2,
+static const YYINT yylen[] = {                            2,
     1,
 };
-static const short yydefred[] = {                         0,
+static const YYINT yydefred[] = {                         0,
     1,    0,
 };
-static const short yydgoto[] = {                          2,
+static const YYINT yydgoto[] = {                          2,
 };
-static const short yysindex[] = {                      -256,
+static const YYINT yysindex[] = {                      -256,
     0,    0,
 };
-static const short yyrindex[] = {                         0,
+static const YYINT yyrindex[] = {                         0,
     0,    0,
 };
-static const short yygindex[] = {                         0,
+static const YYINT yygindex[] = {                         0,
 };
 #define YYTABLESIZE 0
-static const short yytable[] = {                          1,
+static const YYINT yytable[] = {                          1,
 };
-static const short yycheck[] = {                        256,
+static const YYINT yycheck[] = {                        256,
 };
 #define YYFINAL 2
 #ifndef YYDEBUG
 #define YYDEBUG 0
 #endif
-#define YYMAXTOKEN 0
-#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
-#if YYDEBUG
-static const char *yyname[] = {
-
-"end-of-file","illegal-symbol",
+#define YYMAXTOKEN 256
+#define YYUNDFTOKEN 259
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
+#if YYDEBUG
+static const char *const yyname[] = {
+
+"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"illegal-symbol",
 };
-static const char *yyrule[] = {
+static const char *const yyrule[] = {
 "$accept : S",
 "S : error",

@@ -124,9 +134,9 @@

 typedef struct {
     unsigned stacksize;
-    short    *s_base;
-    short    *s_mark;
-    short    *s_last;
+    YYINT    *s_base;
+    YYINT    *s_mark;
+    YYINT    *s_last;
     YYSTYPE  *l_base;
     YYSTYPE  *l_mark;
 } YYSTACKDATA;
@@ -154,7 +164,7 @@
 {
     printf("%s\n", s);
 }
-#line 156 "/dev/stdout"
+#line 168 "/dev/stdout"

 #if YYDEBUG
 #include               /* needed for printf */
@@ -168,27 +178,27 @@
 {
     int i;
     unsigned newsize;
-    short *newss;
+    YYINT *newss;
     YYSTYPE *newvs;

     if ((newsize = data->stacksize) == 0)
         newsize = YYINITSTACKSIZE;
     else if (newsize >= YYMAXDEPTH)
-        return -1;
+        return YYENOMEM;
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;

     i = (int) (data->s_mark - data->s_base);
-    newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
+    newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
-        return -1;
+        return YYENOMEM;

     data->s_base = newss;
     data->s_mark = newss + i;

     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
     if (newvs == 0)
-        return -1;
+        return YYENOMEM;

     data->l_base = newvs;
     data->l_mark = newvs + i;
@@ -238,7 +248,7 @@
     memset(&yystack, 0, sizeof(yystack));
 #endif

-    if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
+    if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyove
rflow;
     yystack.s_mark = yystack.s_base;
     yystack.l_mark = yystack.l_base;
     yystate = 0;
@@ -248,7 +258,7 @@
     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
     if (yychar < 0)
     {
-        if ((yychar = YYLEX) < 0) yychar = 0;
+        if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
         if (yydebug)
         {
@@ -266,7 +276,7 @@
             printf("%sdebug: state %d, shifting to state %d\n",
                     YYPREFIX, yystate, yytable[yyn]);
 #endif
-        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOM
EM)
         {
             goto yyoverflow;
         }
@@ -285,7 +295,7 @@
     }
     if (yyerrflag) goto yyinrecovery;

-    yyerror("syntax error");
+    YYERROR_CALL("syntax error");

     goto yyerrlab;

@@ -306,7 +316,7 @@
                     printf("%sdebug: state %d, error recovery shifting\
  to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
 #endif
-                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) =
= YYENOMEM)
                 {
                     goto yyoverflow;
                 }
@@ -330,7 +340,7 @@
     }
     else
     {
-        if (yychar == 0) goto yyabort;
+        if (yychar == YYEOF) goto yyabort;
 #if YYDEBUG
         if (yydebug)
         {
@@ -373,7 +383,7 @@
         *++yystack.l_mark = yyval;
         if (yychar < 0)
         {
-            if ((yychar = YYLEX) < 0) yychar = 0;
+            if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
             if (yydebug)
             {
@@ -383,7 +393,7 @@
             }
 #endif
         }
-        if (yychar == 0) goto yyaccept;
+        if (yychar == YYEOF) goto yyaccept;
         goto yyloop;
     }
     if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
@@ -396,16 +406,16 @@
         printf("%sdebug: after reduction, shifting from state %d \
 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
 #endif
-    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
     {
         goto yyoverflow;
     }
-    *++yystack.s_mark = (short) yystate;
+    *++yystack.s_mark = (YYINT) yystate;
     *++yystack.l_mark = yyval;
     goto yyloop;

 yyoverflow:
-    yyerror("yacc stack overflow");
+    YYERROR_CALL("yacc stack overflow");

 yyabort:
     yyfreestack(&yystack);
not ok - 06 # Test failed: regression detected.  See above. (in .)
--- /usr/tests/usr.bin/yacc/regress.07.out      2014-12-02 08:00:18.000000000 +0
000
+++ -   2014-12-03 01:07:29.531831468 +0000
@@ -1,17 +1,17 @@
-#ifndef lint
-static const char yysccsid[] = "@(#)yaccpar    1.9 (Berkeley) 02/21/93";
-#endif
+/* original parser id follows */
+/* yysccsid[] = "@(#)yaccpar   1.9 (Berkeley) 02/21/93" */
+/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */

 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
-#define YYPATCH 20140101

 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
 #define yyerrok        (yyerrflag = 0)
 #define YYRECOVERING() (yyerrflag != 0)
-
+#define YYENOMEM       (-2)
+#define YYEOF          0
 #define YYPREFIX "yy"

 #define YYPURE 0
@@ -115,10 +115,12 @@
 {
        perror(msg);
 }
-#line 118 "/dev/stdout"
+#line 119 "/dev/stdout"

-#ifndef YYSTYPE
+#if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
+/* Default: YYSTYPE is the semantic value type. */
 typedef int YYSTYPE;
+# define YYSTYPE_IS_DECLARED 1
 #endif

 /* compatibility with bison */
@@ -216,7 +218,8 @@
 #define CHMOD 318
 #define LEXERR 319
 #define YYERRCODE 256
-static const short yylhs[] = {                           -1,
+typedef short YYINT;
+static const YYINT yylhs[] = {                           -1,
     0,    0,    0,    1,    1,    1,    1,    1,    1,    1,
     1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
     1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -226,7 +229,7 @@
     6,    6,    6,    7,    7,    7,    8,    8,    8,   10,
    14,   11,    9,
 };
-static const short yylen[] = {                            2,
+static const YYINT yylen[] = {                            2,
     0,    2,    2,    4,    4,    4,    2,    4,    4,    4,
     4,    8,    5,    5,    5,    3,    5,    3,    5,    5,
     2,    5,    4,    2,    3,    5,    2,    4,    2,    5,
@@ -236,7 +239,7 @@
     1,    3,    2,    1,    1,    1,    1,    1,    1,    1,
     1,    1,    0,
 };
-static const short yydefred[] = {                         1,
+static const YYINT yydefred[] = {                         1,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    73,   73,   73,    0,   73,    0,    0,   73,   73,   73,
    73,    0,    0,    0,    0,   73,   73,   73,   73,   73,
@@ -258,11 +261,11 @@
     0,   35,   72,    0,   40,    0,    0,    0,   37,    0,
     0,   12,    0,    0,   38,    0,    0,    0,   52,
 };
-static const short yydgoto[] = {                          1,
+static const YYINT yydgoto[] = {                          1,
    34,   35,   71,   73,   75,   80,   84,   88,   45,   95,
   184,  125,  157,   96,
 };
-static const short yysindex[] = {                         0,
+static const YYINT yysindex[] = {                         0,
  -224, -247, -239, -236, -232, -222, -204, -200, -181, -177,
     0,    0,    0, -166,    0, -161, -199,    0,    0,    0,
     0, -160, -159, -264, -158,    0,    0,    0,    0,    0,
@@ -284,7 +287,7 @@
   -97,    0,    0,  -95,    0,  -96,  -94,  -92,    0, -152,
   -93,    0,  -91,  -90,    0,  -88,  -87,  -86,    0,
 };
-static const short yyrindex[] = {                         0,
+static const YYINT yyrindex[] = {                         0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,  -83,    0,    0,    0,    0,    0,    0,    0,
@@ -306,12 +309,12 @@
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,
 };
-static const short yygindex[] = {                         0,
+static const YYINT yygindex[] = {                         0,
     0,    0,    0,    0,    0,    0,    0,    0,   16,  -89,
   -25,   35,   47,    0,
 };
 #define YYTABLESIZE 190
-static const short yytable[] = {                        129,
+static const YYINT yytable[] = {                        129,
   130,  131,  104,  134,   59,   60,   76,  136,  137,   77,
   138,   78,   79,  105,  106,  107,   98,   99,  146,  123,
   148,  149,   36,  124,  150,  151,  152,   46,   47,   37,
@@ -332,7 +335,7 @@
   183,  185,  190,  187,  189,  188,  191,  192,  195,  194,
   196,    0,    0,  198,  197,   73,  199,   49,   56,   58,
 };
-static const short yycheck[] = {                         89,
+static const YYINT yycheck[] = {                         89,
    90,   91,  305,   93,  269,  270,  257,   97,   98,  260,
   100,  262,  263,  316,  317,  318,  269,  270,  108,  269,
   110,  111,  270,  273,  114,  115,  116,   12,   13,  269,
@@ -358,9 +361,10 @@
 #define YYDEBUG 0
 #endif
 #define YYMAXTOKEN 319
-#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
+#define YYUNDFTOKEN 336
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
 #if YYDEBUG
-static const char *yyname[] = {
+static const char *const yyname[] = {

 "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
@@ -373,10 +377,10 @@
 "REIN","QUIT","PORT","PASV","TYPE","STRU","MODE","RETR","STOR","APPE","MLFL",
 "MAIL","MSND","MSOM","MSAM","MRSQ","MRCP","ALLO","REST","RNFR","RNTO","ABOR",
 "DELE","CWD","LIST","NLST","SITE","STAT","HELP","NOOP","MKD","RMD","PWD","CDUP"
,
-"STOU","SMNT","SYST","SIZE","MDTM","UMASK","IDLE","CHMOD","LEXERR",
-"illegal-symbol",
+"STOU","SMNT","SYST","SIZE","MDTM","UMASK","IDLE","CHMOD","LEXERR",0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,"illegal-symbol",
 };
-static const char *yyrule[] = {
+static const char *const yyrule[] = {
 "$accept : cmd_list",
 "cmd_list :",
 "cmd_list : cmd_list cmd",
@@ -480,9 +484,9 @@

 typedef struct {
     unsigned stacksize;
-    short    *s_base;
-    short    *s_mark;
-    short    *s_last;
+    YYINT    *s_base;
+    YYINT    *s_mark;
+    YYINT    *s_last;
     YYSTYPE  *l_base;
     YYSTYPE  *l_mark;
 } YYSTACKDATA;
@@ -1011,7 +1015,7 @@
                reply(504, "SIZE not implemented for Type %c.", "?AEIL"[type]);
        }
 }
-#line 1013 "/dev/stdout"
+#line 1019 "/dev/stdout"

 #if YYDEBUG
 #include               /* needed for printf */
@@ -1025,27 +1029,27 @@
 {
     int i;
     unsigned newsize;
-    short *newss;
+    YYINT *newss;
     YYSTYPE *newvs;

     if ((newsize = data->stacksize) == 0)
         newsize = YYINITSTACKSIZE;
     else if (newsize >= YYMAXDEPTH)
-        return -1;
+        return YYENOMEM;
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;

     i = (int) (data->s_mark - data->s_base);
-    newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
+    newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
-        return -1;
+        return YYENOMEM;

     data->s_base = newss;
     data->s_mark = newss + i;

     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
     if (newvs == 0)
-        return -1;
+        return YYENOMEM;

     data->l_base = newvs;
     data->l_mark = newvs + i;
@@ -1095,7 +1099,7 @@
     memset(&yystack, 0, sizeof(yystack));
 #endif

-    if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
+    if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyove
rflow;
     yystack.s_mark = yystack.s_base;
     yystack.l_mark = yystack.l_base;
     yystate = 0;
@@ -1105,7 +1109,7 @@
     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
     if (yychar < 0)
     {
-        if ((yychar = YYLEX) < 0) yychar = 0;
+        if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
         if (yydebug)
         {
@@ -1123,7 +1127,7 @@
             printf("%sdebug: state %d, shifting to state %d\n",
                     YYPREFIX, yystate, yytable[yyn]);
 #endif
-        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOM
EM)
         {
             goto yyoverflow;
         }
@@ -1142,7 +1146,7 @@
     }
     if (yyerrflag) goto yyinrecovery;

-    yyerror("syntax error");
+    YYERROR_CALL("syntax error");

     goto yyerrlab;

@@ -1163,7 +1167,7 @@
                     printf("%sdebug: state %d, error recovery shifting\
  to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
 #endif
-                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) =
= YYENOMEM)
                 {
                     goto yyoverflow;
                 }
@@ -1187,7 +1191,7 @@
     }
     else
     {
-        if (yychar == 0) goto yyabort;
+        if (yychar == YYEOF) goto yyabort;
 #if YYDEBUG
         if (yydebug)
         {
@@ -1850,7 +1854,7 @@
                }
        }
 break;
-#line 1852 "/dev/stdout"
+#line 1858 "/dev/stdout"
     }
     yystack.s_mark -= yym;
     yystate = *yystack.s_mark;
@@ -1868,7 +1872,7 @@
         *++yystack.l_mark = yyval;
         if (yychar < 0)
         {
-            if ((yychar = YYLEX) < 0) yychar = 0;
+            if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
             if (yydebug)
             {
@@ -1878,7 +1882,7 @@
             }
 #endif
         }
-        if (yychar == 0) goto yyaccept;
+        if (yychar == YYEOF) goto yyaccept;
         goto yyloop;
     }
     if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
@@ -1891,16 +1895,16 @@
         printf("%sdebug: after reduction, shifting from state %d \
 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
 #endif
-    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
     {
         goto yyoverflow;
     }
-    *++yystack.s_mark = (short) yystate;
+    *++yystack.s_mark = (YYINT) yystate;
     *++yystack.l_mark = yyval;
     goto yyloop;

 yyoverflow:
-    yyerror("yacc stack overflow");
+    YYERROR_CALL("yacc stack overflow");

 yyabort:
     yyfreestack(&yystack);
not ok - 07 # Test failed: regression detected.  See above. (in .)
--- /usr/tests/usr.bin/yacc/regress.08.out      2014-12-02 08:00:18.000000000 +0
000
+++ -   2014-12-03 01:07:29.542141068 +0000
@@ -1,17 +1,17 @@
-#ifndef lint
-static const char yysccsid[] = "@(#)yaccpar    1.9 (Berkeley) 02/21/93";
-#endif
+/* original parser id follows */
+/* yysccsid[] = "@(#)yaccpar   1.9 (Berkeley) 02/21/93" */
+/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */

 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
-#define YYPATCH 20140101

 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
 #define yyerrok        (yyerrflag = 0)
 #define YYRECOVERING() (yyerrflag != 0)
-
+#define YYENOMEM       (-2)
+#define YYEOF          0
 #define YYPREFIX "yy"

 #define YYPURE 0
@@ -303,7 +303,7 @@
     }
     return FALSE;
 }
-#line 306 "/dev/stdout"
+#line 307 "/dev/stdout"

 /* compatibility with bison */
 #ifdef YYPARSE_PARAM
@@ -372,7 +372,8 @@
 #define T_ASMARG 290
 #define T_VA_DCL 291
 #define YYERRCODE 256
-static const short yylhs[] = {                           -1,
+typedef short YYINT;
+static const YYINT yylhs[] = {                           -1,
     0,    0,   26,   26,   27,   27,   27,   27,   27,   27,
    27,   31,   30,   30,   28,   28,   34,   28,   32,   32,
    33,   33,   35,   35,   37,   38,   29,   39,   29,   36,
@@ -386,7 +387,7 @@
    18,   18,   24,   24,   12,   12,   12,   13,   13,   13,
    13,   13,   13,   13,
 };
-static const short yylen[] = {                            2,
+static const YYINT yylen[] = {                            2,
     0,    1,    1,    2,    1,    1,    1,    1,    3,    2,
     2,    2,    3,    3,    2,    3,    0,    5,    2,    1,
     0,    1,    1,    3,    0,    0,    7,    0,    5,    0,
@@ -400,7 +401,7 @@
     1,    3,    1,    2,    1,    2,    1,    3,    2,    1,
     4,    3,    3,    2,
 };
-static const short yydefred[] = {                         0,
+static const YYINT yydefred[] = {                         0,
     0,    0,    0,    0,   77,    0,   62,   40,    0,   42,
    43,   20,   44,    0,   46,   47,   48,   49,   54,   50,
    51,   52,   53,   76,   66,   67,   55,   56,   57,   61,
@@ -417,14 +418,14 @@
    29,  114,    0,    0,    0,  109,    0,   93,   95,  102,
    18,    0,    0,  108,  113,  112,    0,   24,   27,  111,
 };
-static const short yydgoto[] = {                         33,
+static const YYINT yydgoto[] = {                         33,
    87,   35,   36,   37,   38,   39,   40,   69,   70,   41,
    42,  119,  120,  100,  101,  102,  103,  104,   43,   44,
    59,   60,   45,   46,   47,   48,   49,   50,   51,   52,
    77,   53,  127,  109,  128,   97,   94,  143,   72,   98,
   112,
 };
-static const short yysindex[] = {                        -2,
+static const YYINT yysindex[] = {                        -2,
    -3,   27, -239, -177,    0,    0,    0,    0, -274,    0,
     0,    0,    0, -246,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
@@ -441,7 +442,7 @@
     0,    0,   53,   55,  417,    0,  -33,    0,    0,    0,
     0,   27, -188,    0,    0,    0,   57,    0,    0,    0,
 };
-static const short yyrindex[] = {                        99,
+static const YYINT yyrindex[] = {                        99,
     0,    0,  275,    0,    0,  -38,    0,    0,  481,    0,
     0,    0,    0,  509,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
@@ -458,7 +459,7 @@
     0,    0,    0,    0,    0,    0,   35,    0,    0,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
 };
-static const short yygindex[] = {                         0,
+static const YYINT yygindex[] = {                         0,
    11,  -17,    0,    0,   13,    0,    0,    0,   20,    8,
   -43,   -1,   -8,  -89,    0,   -9,    0,    0,    0,  -44,
     0,    0,    4,    0,    0,    0,   70,  -53,    0,    0,
@@ -466,7 +467,7 @@
     0,
 };
 #define YYTABLESIZE 924
-static const short yytable[] = {                         58,
+static const YYINT yytable[] = {                         58,
    78,   58,   58,   58,   73,   58,  135,   61,   88,   57,
    34,    5,   56,   62,   85,   58,   68,   63,   96,    7,
    58,   98,   78,   64,   98,   84,  134,  107,   80,    3,
@@ -561,7 +562,7 @@
    17,   18,   19,   20,   21,   22,   23,   24,   25,   26,
    27,   28,   29,   30,
 };
-static const short yycheck[] = {                         38,
+static const YYINT yycheck[] = {                         38,
    44,   40,   41,   42,   40,   44,   40,    4,   62,    2,
     0,  257,  258,  288,   59,    3,   34,  264,   72,  259,
    59,   41,   61,  290,   44,   41,  116,   41,   47,   42,
@@ -661,9 +662,10 @@
 #define YYDEBUG 0
 #endif
 #define YYMAXTOKEN 291
-#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
+#define YYUNDFTOKEN 335
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
 #if YYDEBUG
-static const char *yyname[] = {
+static const char *const yyname[] = {

 "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,"'&'",0,"'('","')'","'*'",0,"','",0,0,0,0,0,0,0,0,0,0,0,0,0,0,"';'",0,
@@ -677,10 +679,11 @@
 "T_DOUBLE","T_FLOAT","T_INT","T_VOID","T_LONG","T_SHORT","T_SIGNED",
 "T_UNSIGNED","T_ENUM","T_STRUCT","T_UNION","T_Bool","T_Complex","T_Imaginary",
 "T_TYPE_QUALIFIER","T_BRACKETS","T_LBRACE","T_MATCHRBRACE","T_ELLIPSIS",
-"T_INITIALIZER","T_STRING_LITERAL","T_ASM","T_ASMARG","T_VA_DCL",
+"T_INITIALIZER","T_STRING_LITERAL","T_ASM","T_ASMARG","T_VA_DCL",0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 "illegal-symbol",
 };
-static const char *yyrule[] = {
+static const char *const yyrule[] = {
 "$accept : program",
 "program :",
 "program : translation_unit",
@@ -825,9 +828,9 @@

 typedef struct {
     unsigned stacksize;
-    short    *s_base;
-    short    *s_mark;
-    short    *s_last;
+    YYINT    *s_base;
+    YYINT    *s_mark;
+    YYINT    *s_last;
     YYSTYPE  *l_base;
     YYSTYPE  *l_mark;
 } YYSTACKDATA;
@@ -1004,7 +1007,7 @@
 #endif
 }
 #endif
-#line 1006 "/dev/stdout"
+#line 1011 "/dev/stdout"

 #if YYDEBUG
 #include               /* needed for printf */
@@ -1018,27 +1021,27 @@
 {
     int i;
     unsigned newsize;
-    short *newss;
+    YYINT *newss;
     YYSTYPE *newvs;

     if ((newsize = data->stacksize) == 0)
         newsize = YYINITSTACKSIZE;
     else if (newsize >= YYMAXDEPTH)
-        return -1;
+        return YYENOMEM;
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;

     i = (int) (data->s_mark - data->s_base);
-    newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
+    newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
-        return -1;
+        return YYENOMEM;

     data->s_base = newss;
     data->s_mark = newss + i;

     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
     if (newvs == 0)
-        return -1;
+        return YYENOMEM;

     data->l_base = newvs;
     data->l_mark = newvs + i;
@@ -1088,7 +1091,7 @@
     memset(&yystack, 0, sizeof(yystack));
 #endif

-    if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
+    if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyove
rflow;
     yystack.s_mark = yystack.s_base;
     yystack.l_mark = yystack.l_base;
     yystate = 0;
@@ -1098,7 +1101,7 @@
     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
     if (yychar < 0)
     {
-        if ((yychar = YYLEX) < 0) yychar = 0;
+        if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
         if (yydebug)
         {
@@ -1116,7 +1119,7 @@
             printf("%sdebug: state %d, shifting to state %d\n",
                     YYPREFIX, yystate, yytable[yyn]);
 #endif
-        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOM
EM)
         {
             goto yyoverflow;
         }
@@ -1135,7 +1138,7 @@
     }
     if (yyerrflag) goto yyinrecovery;

-    yyerror("syntax error");
+    YYERROR_CALL("syntax error");

     goto yyerrlab;

@@ -1156,7 +1159,7 @@
                     printf("%sdebug: state %d, error recovery shifting\
  to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
 #endif
-                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) =
= YYENOMEM)
                 {
                     goto yyoverflow;
                 }
@@ -1180,7 +1183,7 @@
     }
     else
     {
-        if (yychar == 0) goto yyabort;
+        if (yychar == YYEOF) goto yyabort;
 #if YYDEBUG
         if (yydebug)
         {
@@ -1880,7 +1883,7 @@
            yyval.declarator->func_def = FUNC_ANSI;
        }
 break;
-#line 1882 "/dev/stdout"
+#line 1887 "/dev/stdout"
     }
     yystack.s_mark -= yym;
     yystate = *yystack.s_mark;
@@ -1898,7 +1901,7 @@
         *++yystack.l_mark = yyval;
         if (yychar < 0)
         {
-            if ((yychar = YYLEX) < 0) yychar = 0;
+            if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
             if (yydebug)
             {
@@ -1908,7 +1911,7 @@
             }
 #endif
         }
-        if (yychar == 0) goto yyaccept;
+        if (yychar == YYEOF) goto yyaccept;
         goto yyloop;
     }
     if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
@@ -1921,16 +1924,16 @@
         printf("%sdebug: after reduction, shifting from state %d \
 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
 #endif
-    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
     {
         goto yyoverflow;
     }
-    *++yystack.s_mark = (short) yystate;
+    *++yystack.s_mark = (YYINT) yystate;
     *++yystack.l_mark = yyval;
     goto yyloop;

 yyoverflow:
-    yyerror("yacc stack overflow");
+    YYERROR_CALL("yacc stack overflow");

 yyabort:
     yyfreestack(&yystack);
not ok - 08 # Test failed: regression detected.  See above. (in .)
--- /usr/tests/usr.bin/yacc/regress.09.out      2014-12-02 08:00:18.000000000 +0
000
+++ -   2014-12-03 01:07:29.554672169 +0000
@@ -1,17 +1,17 @@
-#ifndef lint
-static const char yysccsid[] = "@(#)yaccpar    1.9 (Berkeley) 02/21/93";
-#endif
+/* original parser id follows */
+/* yysccsid[] = "@(#)yaccpar   1.9 (Berkeley) 02/21/93" */
+/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */

 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
-#define YYPATCH 20140101

 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
 #define yyerrok        (yyerrflag = 0)
 #define YYRECOVERING() (yyerrflag != 0)
-
+#define YYENOMEM       (-2)
+#define YYEOF          0
 #define YYPREFIX "yy"

 #define YYPURE 0
@@ -32,10 +32,12 @@
 static void YYERROR_DECL();
 #endif

-#line 35 "/dev/stdout"
+#line 36 "/dev/stdout"

-#ifndef YYSTYPE
+#if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
+/* Default: YYSTYPE is the semantic value type. */
 typedef int YYSTYPE;
+# define YYSTYPE_IS_DECLARED 1
 #endif

 /* compatibility with bison */
@@ -73,40 +75,41 @@
 #define LETTER 258
 #define UMINUS 259
 #define YYERRCODE 256
-static const short yylhs[] = {                           -1,
+typedef short YYINT;
+static const YYINT yylhs[] = {                           -1,
     0,    0,    0,    1,    1,    2,    2,    2,    2,    2,
     2,    2,    2,    2,    2,    2,    3,    3,
 };
-static const short yylen[] = {                            2,
+static const YYINT yylen[] = {                            2,
     0,    3,    3,    1,    3,    3,    3,    3,    3,    3,
     3,    3,    3,    2,    1,    1,    1,    2,
 };
-static const short yydefred[] = {                         1,
+static const YYINT yydefred[] = {                         1,
     0,    0,   17,    0,    0,    0,    0,    0,    0,    3,
     0,   15,   14,    0,    2,    0,    0,    0,    0,    0,
     0,    0,   18,    0,    6,    0,    0,    0,    0,    9,
    10,   11,
 };
-static const short yydgoto[] = {                          1,
+static const YYINT yydgoto[] = {                          1,
     7,    8,    9,
 };
-static const short yysindex[] = {                         0,
+static const YYINT yysindex[] = {                         0,
   -40,   -7,    0,  -55,  -38,  -38,    1,  -29, -247,    0,
   -38,    0,    0,   22,    0,  -38,  -38,  -38,  -38,  -38,
   -38,  -38,    0,  -29,    0,   51,   60,  -20,  -20,    0,
     0,    0,
 };
-static const short yyrindex[] = {                         0,
+static const YYINT yyrindex[] = {                         0,
     0,    0,    0,    2,    0,    0,    0,    9,   -9,    0,
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,   10,    0,   -6,   14,    5,   13,    0,
     0,    0,
 };
-static const short yygindex[] = {                         0,
+static const YYINT yygindex[] = {                         0,
     0,   65,    0,
 };
 #define YYTABLESIZE 220
-static const short yytable[] = {                          6,
+static const YYINT yytable[] = {                          6,
    16,    6,   10,   13,    5,   11,    5,   22,   17,   23,
    15,   15,   20,   18,    7,   19,   22,   21,    4,    5,
     0,   20,    8,   12,    0,    0,   21,   16,   16,    0,
@@ -130,7 +133,7 @@
     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,    0,    0,    2,    3,    4,    3,   12,
 };
-static const short yycheck[] = {                         40,
+static const YYINT yycheck[] = {                         40,
    10,   40,   10,   10,   45,   61,   45,   37,   38,  257,
    10,   10,   42,   43,   10,   45,   37,   47,   10,   10,
    -1,   42,   10,   10,   -1,   -1,   47,   37,   38,   -1,
@@ -159,9 +162,10 @@
 #define YYDEBUG 0
 #endif
 #define YYMAXTOKEN 259
-#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
+#define YYUNDFTOKEN 265
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
 #if YYDEBUG
-static const char *yyname[] = {
+static const char *const yyname[] = {

 "end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0
,
@@ -170,9 +174,9 @@
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
-0,0,0,0,0,0,"DIGIT","LETTER","UMINUS","illegal-symbol",
+0,0,0,0,0,0,"DIGIT","LETTER","UMINUS",0,0,0,0,0,"illegal-symbol",
 };
-static const char *yyrule[] = {
+static const char *const yyrule[] = {
 "$accept : list",
 "list :",
 "list : list stat '\\n'",
@@ -221,9 +225,9 @@

 typedef struct {
     unsigned stacksize;
-    short    *s_base;
-    short    *s_mark;
-    short    *s_last;
+    YYINT    *s_base;
+    YYINT    *s_mark;
+    YYINT    *s_last;
     YYSTYPE  *l_base;
     YYSTYPE  *l_mark;
 } YYSTACKDATA;
@@ -275,7 +279,7 @@
     }
     return( c );
 }
-#line 277 "/dev/stdout"
+#line 283 "/dev/stdout"

 #if YYDEBUG
 #include               /* needed for printf */
@@ -289,27 +293,27 @@
 {
     int i;
     unsigned newsize;
-    short *newss;
+    YYINT *newss;
     YYSTYPE *newvs;

     if ((newsize = data->stacksize) == 0)
         newsize = YYINITSTACKSIZE;
     else if (newsize >= YYMAXDEPTH)
-        return -1;
+        return YYENOMEM;
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;

     i = (int) (data->s_mark - data->s_base);
-    newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
+    newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
-        return -1;
+        return YYENOMEM;

     data->s_base = newss;
     data->s_mark = newss + i;

     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
     if (newvs == 0)
-        return -1;
+        return YYENOMEM;

     data->l_base = newvs;
     data->l_mark = newvs + i;
@@ -359,7 +363,7 @@
     memset(&yystack, 0, sizeof(yystack));
 #endif

-    if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
+    if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyove
rflow;
     yystack.s_mark = yystack.s_base;
     yystack.l_mark = yystack.l_base;
     yystate = 0;
@@ -369,7 +373,7 @@
     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
     if (yychar < 0)
     {
-        if ((yychar = YYLEX) < 0) yychar = 0;
+        if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
         if (yydebug)
         {
@@ -387,7 +391,7 @@
             printf("%sdebug: state %d, shifting to state %d\n",
                     YYPREFIX, yystate, yytable[yyn]);
 #endif
-        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOM
EM)
         {
             goto yyoverflow;
         }
@@ -406,7 +410,7 @@
     }
     if (yyerrflag) goto yyinrecovery;

-    yyerror("syntax error");
+    YYERROR_CALL("syntax error");

     goto yyerrlab;

@@ -427,7 +431,7 @@
                     printf("%sdebug: state %d, error recovery shifting\
  to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
 #endif
-                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) =
= YYENOMEM)
                 {
                     goto yyoverflow;
                 }
@@ -451,7 +455,7 @@
     }
     else
     {
-        if (yychar == 0) goto yyabort;
+        if (yychar == YYEOF) goto yyabort;
 #if YYDEBUG
         if (yydebug)
         {
@@ -537,7 +541,7 @@
 #line 69 "pure_calc.y"
        {  yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
 break;
-#line 539 "/dev/stdout"
+#line 545 "/dev/stdout"
     }
     yystack.s_mark -= yym;
     yystate = *yystack.s_mark;
@@ -555,7 +559,7 @@
         *++yystack.l_mark = yyval;
         if (yychar < 0)
         {
-            if ((yychar = YYLEX) < 0) yychar = 0;
+            if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
             if (yydebug)
             {
@@ -565,7 +569,7 @@
             }
 #endif
         }
-        if (yychar == 0) goto yyaccept;
+        if (yychar == YYEOF) goto yyaccept;
         goto yyloop;
     }
     if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
@@ -578,16 +582,16 @@
         printf("%sdebug: after reduction, shifting from state %d \
 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
 #endif
-    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
     {
         goto yyoverflow;
     }
-    *++yystack.s_mark = (short) yystate;
+    *++yystack.s_mark = (YYINT) yystate;
     *++yystack.l_mark = yyval;
     goto yyloop;

 yyoverflow:
-    yyerror("yacc stack overflow");
+    YYERROR_CALL("yacc stack overflow");

 yyabort:
     yyfreestack(&yystack);
not ok - 09 # Test failed: regression detected.  See above. (in .)
--- /usr/tests/usr.bin/yacc/regress.10.out      2014-12-02 08:00:18.000000000 +0
000
+++ -   2014-12-03 01:07:29.567806168 +0000
@@ -1,17 +1,17 @@
-#ifndef lint
-static const char yysccsid[] = "@(#)yaccpar    1.9 (Berkeley) 02/21/93";
-#endif
+/* original parser id follows */
+/* yysccsid[] = "@(#)yaccpar   1.9 (Berkeley) 02/21/93" */
+/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */

 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
-#define YYPATCH 20140101

 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
 #define yyerrok        (yyerrflag = 0)
 #define YYRECOVERING() (yyerrflag != 0)
-
+#define YYENOMEM       (-2)
+#define YYEOF          0
 #define YYPREFIX "yy"

 #define YYPURE 0
@@ -27,10 +27,12 @@
 static void YYERROR_DECL();
 #endif

-#line 30 "/dev/stdout"
+#line 31 "/dev/stdout"

-#ifndef YYSTYPE
+#if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
+/* Default: YYSTYPE is the semantic value type. */
 typedef int YYSTYPE;
+# define YYSTYPE_IS_DECLARED 1
 #endif

 /* compatibility with bison */
@@ -65,42 +67,50 @@
 extern int YYPARSE_DECL();

 #define YYERRCODE 256
-static const short yylhs[] = {                           -1,
+typedef short YYINT;
+static const YYINT yylhs[] = {                           -1,
     0,
 };
-static const short yylen[] = {                            2,
+static const YYINT yylen[] = {                            2,
     1,
 };
-static const short yydefred[] = {                         0,
+static const YYINT yydefred[] = {                         0,
     1,    0,
 };
-static const short yydgoto[] = {                          2,
+static const YYINT yydgoto[] = {                          2,
 };
-static const short yysindex[] = {                      -256,
+static const YYINT yysindex[] = {                      -256,
     0,    0,
 };
-static const short yyrindex[] = {                         0,
+static const YYINT yyrindex[] = {                         0,
     0,    0,
 };
-static const short yygindex[] = {                         0,
+static const YYINT yygindex[] = {                         0,
 };
 #define YYTABLESIZE 0
-static const short yytable[] = {                          1,
+static const YYINT yytable[] = {                          1,
 };
-static const short yycheck[] = {                        256,
+static const YYINT yycheck[] = {                        256,
 };
 #define YYFINAL 2
 #ifndef YYDEBUG
 #define YYDEBUG 0
 #endif
-#define YYMAXTOKEN 0
-#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
-#if YYDEBUG
-static const char *yyname[] = {
-
-"end-of-file","illegal-symbol",
+#define YYMAXTOKEN 256
+#define YYUNDFTOKEN 259
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
+#if YYDEBUG
+static const char *const yyname[] = {
+
+"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"illegal-symbol",
 };
-static const char *yyrule[] = {
+static const char *const yyrule[] = {
 "$accept : S",
 "S : error",

@@ -132,9 +142,9 @@

 typedef struct {
     unsigned stacksize;
-    short    *s_base;
-    short    *s_mark;
-    short    *s_last;
+    YYINT    *s_base;
+    YYINT    *s_mark;
+    YYINT    *s_last;
     YYSTYPE  *l_base;
     YYSTYPE  *l_mark;
 } YYSTACKDATA;
@@ -166,7 +176,7 @@
 {
     printf("%s\n", s);
 }
-#line 168 "/dev/stdout"
+#line 180 "/dev/stdout"

 #if YYDEBUG
 #include               /* needed for printf */
@@ -180,27 +190,27 @@
 {
     int i;
     unsigned newsize;
-    short *newss;
+    YYINT *newss;
     YYSTYPE *newvs;

     if ((newsize = data->stacksize) == 0)
         newsize = YYINITSTACKSIZE;
     else if (newsize >= YYMAXDEPTH)
-        return -1;
+        return YYENOMEM;
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;

     i = (int) (data->s_mark - data->s_base);
-    newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
+    newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
-        return -1;
+        return YYENOMEM;

     data->s_base = newss;
     data->s_mark = newss + i;

     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
     if (newvs == 0)
-        return -1;
+        return YYENOMEM;

     data->l_base = newvs;
     data->l_mark = newvs + i;
@@ -250,7 +260,7 @@
     memset(&yystack, 0, sizeof(yystack));
 #endif

-    if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
+    if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyove
rflow;
     yystack.s_mark = yystack.s_base;
     yystack.l_mark = yystack.l_base;
     yystate = 0;
@@ -260,7 +270,7 @@
     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
     if (yychar < 0)
     {
-        if ((yychar = YYLEX) < 0) yychar = 0;
+        if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
         if (yydebug)
         {
@@ -278,7 +288,7 @@
             printf("%sdebug: state %d, shifting to state %d\n",
                     YYPREFIX, yystate, yytable[yyn]);
 #endif
-        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOM
EM)
         {
             goto yyoverflow;
         }
@@ -297,7 +307,7 @@
     }
     if (yyerrflag) goto yyinrecovery;

-    yyerror("syntax error");
+    YYERROR_CALL("syntax error");

     goto yyerrlab;

@@ -318,7 +328,7 @@
                     printf("%sdebug: state %d, error recovery shifting\
  to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
 #endif
-                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) =
= YYENOMEM)
                 {
                     goto yyoverflow;
                 }
@@ -342,7 +352,7 @@
     }
     else
     {
-        if (yychar == 0) goto yyabort;
+        if (yychar == YYEOF) goto yyabort;
 #if YYDEBUG
         if (yydebug)
         {
@@ -385,7 +395,7 @@
         *++yystack.l_mark = yyval;
         if (yychar < 0)
         {
-            if ((yychar = YYLEX) < 0) yychar = 0;
+            if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
             if (yydebug)
             {
@@ -395,7 +405,7 @@
             }
 #endif
         }
-        if (yychar == 0) goto yyaccept;
+        if (yychar == YYEOF) goto yyaccept;
         goto yyloop;
     }
     if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
@@ -408,16 +418,16 @@
         printf("%sdebug: after reduction, shifting from state %d \
 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
 #endif
-    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
     {
         goto yyoverflow;
     }
-    *++yystack.s_mark = (short) yystate;
+    *++yystack.s_mark = (YYINT) yystate;
     *++yystack.l_mark = yyval;
     goto yyloop;

 yyoverflow:
-    yyerror("yacc stack overflow");
+    YYERROR_CALL("yacc stack overflow");

 yyabort:
     yyfreestack(&yystack);
not ok - 10 # Test failed: regression detected.  See above. (in .)
--- /usr/tests/usr.bin/yacc/regress.11.out      2014-12-02 08:00:18.000000000 +0
000
+++ -   2014-12-03 01:07:29.573037268 +0000
@@ -1,17 +1,17 @@
-#ifndef lint
-static const char yysccsid[] = "@(#)yaccpar    1.9 (Berkeley) 02/21/93";
-#endif
+/* original parser id follows */
+/* yysccsid[] = "@(#)yaccpar   1.9 (Berkeley) 02/21/93" */
+/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */

 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
-#define YYPATCH 20140101

 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
 #define yyerrok        (yyerrflag = 0)
 #define YYRECOVERING() (yyerrflag != 0)
-
+#define YYENOMEM       (-2)
+#define YYEOF          0
 #define YYPREFIX "yy"

 #define YYPURE 0
@@ -26,10 +26,12 @@
 int yylex(void);
 static void yyerror(const char *s);

-#line 29 "/dev/stdout"
+#line 30 "/dev/stdout"

-#ifndef YYSTYPE
+#if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
+/* Default: YYSTYPE is the semantic value type. */
 typedef int YYSTYPE;
+# define YYSTYPE_IS_DECLARED 1
 #endif

 /* compatibility with bison */
@@ -79,40 +81,41 @@
 #define LETTER 270
 #define UMINUS 271
 #define YYERRCODE 256
-static const short yylhs[] = {                           -1,
+typedef short YYINT;
+static const YYINT yylhs[] = {                           -1,
     0,    0,    0,    1,    1,    2,    2,    2,    2,    2,
     2,    2,    2,    2,    2,    2,    3,    3,
 };
-static const short yylen[] = {                            2,
+static const YYINT yylen[] = {                            2,
     0,    3,    3,    1,    3,    3,    3,    3,    3,    3,
     3,    3,    3,    2,    1,    1,    1,    2,
 };
-static const short yydefred[] = {                         1,
+static const YYINT yydefred[] = {                         1,
     0,    0,    0,   17,    0,    0,    0,    0,    0,    3,
    15,    0,    0,    0,    2,    0,    0,    0,    0,    0,
     0,    0,   18,    0,    6,    0,    0,    0,    0,    0,
     0,    0,
 };
-static const short yydgoto[] = {                          1,
+static const YYINT yydgoto[] = {                          1,
     7,    8,    9,
 };
-static const short yysindex[] = {                         0,
+static const YYINT yysindex[] = {                         0,
   -38,    5,  -36,    0,  -51,  -36,    7, -121, -248,    0,
     0, -243,  -36,  -22,    0,  -36,  -36,  -36,  -36,  -36,
   -36,  -36,    0, -121,    0, -121, -121, -121, -121, -121,
  -121, -243,
 };
-static const short yyrindex[] = {                         0,
+static const YYINT yyrindex[] = {                         0,
     0,    0,    0,    0,   -9,    0,    0,   13,  -10,    0,
     0,   -5,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,   15,    0,   -3,   -2,   -1,    1,    2,
     3,   -4,
 };
-static const short yygindex[] = {                         0,
+static const YYINT yygindex[] = {                         0,
     0,   42,    0,
 };
 #define YYTABLESIZE 258
-static const short yytable[] = {                         16,
+static const YYINT yytable[] = {                         16,
    15,    6,   22,    6,   14,   13,    7,    8,    9,   13,
    10,   11,   12,   16,   10,   17,   15,   18,   25,   19,
    23,   20,    4,   21,    5,    0,    0,    0,    0,    0,
@@ -140,7 +143,7 @@
    19,    0,   20,    0,   21,    0,   16,   15,   16,   15,
    16,   15,   16,   15,   16,   15,   16,   15,
 };
-static const short yycheck[] = {                         10,
+static const YYINT yycheck[] = {                         10,
    10,   40,  124,   40,   10,   10,   10,   10,   10,   61,
    10,   10,   10,  257,   10,  259,   10,  261,   41,  263,
   269,  265,   10,  267,   10,   -1,   -1,   -1,   -1,   -1,
@@ -173,9 +176,10 @@
 #define YYDEBUG 0
 #endif
 #define YYMAXTOKEN 271
-#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
+#define YYUNDFTOKEN 277
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
 #if YYDEBUG
-static const char *yyname[] = {
+static const char *const yyname[] = {

 "end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0
,
@@ -185,10 +189,10 @@
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,"OP_ADD","\"ADD\"","OP_SUB","\"SUB\"","OP_MUL","\"MUL\"","OP_DIV",
-"\"DIV\"","OP_MOD","\"MOD\"","OP_AND","\"AND\"","DIGIT","LETTER","UMINUS",
-"illegal-symbol",
+"\"DIV\"","OP_MOD","\"MOD\"","OP_AND","\"AND\"","DIGIT","LETTER","UMINUS",0,0,0
,
+0,0,"illegal-symbol",
 };
-static const char *yyrule[] = {
+static const char *const yyrule[] = {
 "$accept : list",
 "list :",
 "list : list stat '\\n'",
@@ -237,9 +241,9 @@

 typedef struct {
     unsigned stacksize;
-    short    *s_base;
-    short    *s_mark;
-    short    *s_last;
+    YYINT    *s_base;
+    YYINT    *s_mark;
+    YYINT    *s_last;
     YYSTYPE  *l_base;
     YYSTYPE  *l_mark;
 } YYSTACKDATA;
@@ -286,7 +290,7 @@
     }
     return( c );
 }
-#line 288 "/dev/stdout"
+#line 294 "/dev/stdout"

 #if YYDEBUG
 #include               /* needed for printf */
@@ -300,27 +304,27 @@
 {
     int i;
     unsigned newsize;
-    short *newss;
+    YYINT *newss;
     YYSTYPE *newvs;

     if ((newsize = data->stacksize) == 0)
         newsize = YYINITSTACKSIZE;
     else if (newsize >= YYMAXDEPTH)
-        return -1;
+        return YYENOMEM;
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;

     i = (int) (data->s_mark - data->s_base);
-    newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
+    newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
-        return -1;
+        return YYENOMEM;

     data->s_base = newss;
     data->s_mark = newss + i;

     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
     if (newvs == 0)
-        return -1;
+        return YYENOMEM;

     data->l_base = newvs;
     data->l_mark = newvs + i;
@@ -370,7 +374,7 @@
     memset(&yystack, 0, sizeof(yystack));
 #endif

-    if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
+    if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyove
rflow;
     yystack.s_mark = yystack.s_base;
     yystack.l_mark = yystack.l_base;
     yystate = 0;
@@ -380,7 +384,7 @@
     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
     if (yychar < 0)
     {
-        if ((yychar = YYLEX) < 0) yychar = 0;
+        if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
         if (yydebug)
         {
@@ -398,7 +402,7 @@
             printf("%sdebug: state %d, shifting to state %d\n",
                     YYPREFIX, yystate, yytable[yyn]);
 #endif
-        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOM
EM)
         {
             goto yyoverflow;
         }
@@ -417,7 +421,7 @@
     }
     if (yyerrflag) goto yyinrecovery;

-    yyerror("syntax error");
+    YYERROR_CALL("syntax error");

     goto yyerrlab;

@@ -438,7 +442,7 @@
                     printf("%sdebug: state %d, error recovery shifting\
  to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
 #endif
-                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) =
= YYENOMEM)
                 {
                     goto yyoverflow;
                 }
@@ -462,7 +466,7 @@
     }
     else
     {
-        if (yychar == 0) goto yyabort;
+        if (yychar == YYEOF) goto yyabort;
 #if YYDEBUG
         if (yydebug)
         {
@@ -548,7 +552,7 @@
 #line 70 "quote_calc.y"
        {  yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
 break;
-#line 550 "/dev/stdout"
+#line 556 "/dev/stdout"
     }
     yystack.s_mark -= yym;
     yystate = *yystack.s_mark;
@@ -566,7 +570,7 @@
         *++yystack.l_mark = yyval;
         if (yychar < 0)
         {
-            if ((yychar = YYLEX) < 0) yychar = 0;
+            if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
             if (yydebug)
             {
@@ -576,7 +580,7 @@
             }
 #endif
         }
-        if (yychar == 0) goto yyaccept;
+        if (yychar == YYEOF) goto yyaccept;
         goto yyloop;
     }
     if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
@@ -589,16 +593,16 @@
         printf("%sdebug: after reduction, shifting from state %d \
 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
 #endif
-    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
     {
         goto yyoverflow;
     }
-    *++yystack.s_mark = (short) yystate;
+    *++yystack.s_mark = (YYINT) yystate;
     *++yystack.l_mark = yyval;
     goto yyloop;

 yyoverflow:
-    yyerror("yacc stack overflow");
+    YYERROR_CALL("yacc stack overflow");

 yyabort:
     yyfreestack(&yystack);
not ok - 11 # Test failed: regression detected.  See above. (in .)
--- /usr/tests/usr.bin/yacc/regress.12.out      2014-12-02 08:00:18.000000000 +0
000
+++ -   2014-12-03 01:07:29.579539168 +0000
@@ -1,17 +1,17 @@
-#ifndef lint
-static const char yysccsid[] = "@(#)yaccpar    1.9 (Berkeley) 02/21/93";
-#endif
+/* original parser id follows */
+/* yysccsid[] = "@(#)yaccpar   1.9 (Berkeley) 02/21/93" */
+/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */

 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
-#define YYPATCH 20140101

 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
 #define yyerrok        (yyerrflag = 0)
 #define YYRECOVERING() (yyerrflag != 0)
-
+#define YYENOMEM       (-2)
+#define YYEOF          0
 #define YYPREFIX "yy"

 #define YYPURE 0
@@ -26,10 +26,12 @@
 int yylex(void);
 static void yyerror(const char *s);

-#line 29 "/dev/stdout"
+#line 30 "/dev/stdout"

-#ifndef YYSTYPE
+#if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
+/* Default: YYSTYPE is the semantic value type. */
 typedef int YYSTYPE;
+# define YYSTYPE_IS_DECLARED 1
 #endif

 /* compatibility with bison */
@@ -79,40 +81,41 @@
 #define LETTER 270
 #define UMINUS 271
 #define YYERRCODE 256
-static const short yylhs[] = {                           -1,
+typedef short YYINT;
+static const YYINT yylhs[] = {                           -1,
     0,    0,    0,    1,    1,    2,    2,    2,    2,    2,
     2,    2,    2,    2,    2,    2,    3,    3,
 };
-static const short yylen[] = {                            2,
+static const YYINT yylen[] = {                            2,
     0,    3,    3,    1,    3,    3,    3,    3,    3,    3,
     3,    3,    3,    2,    1,    1,    1,    2,
 };
-static const short yydefred[] = {                         1,
+static const YYINT yydefred[] = {                         1,
     0,    0,    0,   17,    0,    0,    0,    0,    0,    3,
    15,    0,    0,    0,    2,    0,    0,    0,    0,    0,
     0,    0,   18,    0,    6,    0,    0,    0,    0,    0,
     0,    0,
 };
-static const short yydgoto[] = {                          1,
+static const YYINT yydgoto[] = {                          1,
     7,    8,    9,
 };
-static const short yysindex[] = {                         0,
+static const YYINT yysindex[] = {                         0,
   -38,    4,  -36,    0,  -51,  -36,    6, -121, -249,    0,
     0, -243,  -36,  -23,    0,  -36,  -36,  -36,  -36,  -36,
   -36,  -36,    0, -121,    0, -121, -121, -121, -121, -121,
  -121, -243,
 };
-static const short yyrindex[] = {                         0,
+static const YYINT yyrindex[] = {                         0,
     0,    0,    0,    0,   -9,    0,    0,   12,  -10,    0,
     0,   -5,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,   14,    0,   -3,   -2,   -1,    1,    2,
     3,   -4,
 };
-static const short yygindex[] = {                         0,
+static const YYINT yygindex[] = {                         0,
     0,   42,    0,
 };
 #define YYTABLESIZE 259
-static const short yytable[] = {                         16,
+static const YYINT yytable[] = {                         16,
    15,    6,   22,    6,   14,   13,    7,    8,    9,   13,
    10,   11,   12,   10,   16,   15,   17,   25,   18,   23,
    19,    4,   20,    5,   21,    0,    0,    0,    0,    0,
@@ -140,7 +143,7 @@
    19,    0,   20,    0,   21,    0,    0,   16,   15,   16,
    15,   16,   15,   16,   15,   16,   15,   16,   15,
 };
-static const short yycheck[] = {                         10,
+static const YYINT yycheck[] = {                         10,
    10,   40,  124,   40,   10,   10,   10,   10,   10,   61,
    10,   10,   10,   10,  258,   10,  260,   41,  262,  269,
   264,   10,  266,   10,  268,   -1,   -1,   -1,   -1,   -1,
@@ -173,9 +176,10 @@
 #define YYDEBUG 0
 #endif
 #define YYMAXTOKEN 271
-#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
+#define YYUNDFTOKEN 277
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
 #if YYDEBUG
-static const char *yyname[] = {
+static const char *const yyname[] = {

 "end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0
,
@@ -185,10 +189,10 @@
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,"OP_ADD","\"ADD\"","OP_SUB","\"SUB\"","OP_MUL","\"MUL\"","OP_DIV",
-"\"DIV\"","OP_MOD","\"MOD\"","OP_AND","\"AND\"","DIGIT","LETTER","UMINUS",
-"illegal-symbol",
+"\"DIV\"","OP_MOD","\"MOD\"","OP_AND","\"AND\"","DIGIT","LETTER","UMINUS",0,0,0
,
+0,0,"illegal-symbol",
 };
-static const char *yyrule[] = {
+static const char *const yyrule[] = {
 "$accept : list",
 "list :",
 "list : list stat '\\n'",
@@ -237,9 +241,9 @@

 typedef struct {
     unsigned stacksize;
-    short    *s_base;
-    short    *s_mark;
-    short    *s_last;
+    YYINT    *s_base;
+    YYINT    *s_mark;
+    YYINT    *s_last;
     YYSTYPE  *l_base;
     YYSTYPE  *l_mark;
 } YYSTACKDATA;
@@ -286,7 +290,7 @@
     }
     return( c );
 }
-#line 288 "/dev/stdout"
+#line 294 "/dev/stdout"

 #if YYDEBUG
 #include               /* needed for printf */
@@ -300,27 +304,27 @@
 {
     int i;
     unsigned newsize;
-    short *newss;
+    YYINT *newss;
     YYSTYPE *newvs;

     if ((newsize = data->stacksize) == 0)
         newsize = YYINITSTACKSIZE;
     else if (newsize >= YYMAXDEPTH)
-        return -1;
+        return YYENOMEM;
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;

     i = (int) (data->s_mark - data->s_base);
-    newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
+    newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
-        return -1;
+        return YYENOMEM;

     data->s_base = newss;
     data->s_mark = newss + i;

     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
     if (newvs == 0)
-        return -1;
+        return YYENOMEM;

     data->l_base = newvs;
     data->l_mark = newvs + i;
@@ -370,7 +374,7 @@
     memset(&yystack, 0, sizeof(yystack));
 #endif

-    if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
+    if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyove
rflow;
     yystack.s_mark = yystack.s_base;
     yystack.l_mark = yystack.l_base;
     yystate = 0;
@@ -380,7 +384,7 @@
     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
     if (yychar < 0)
     {
-        if ((yychar = YYLEX) < 0) yychar = 0;
+        if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
         if (yydebug)
         {
@@ -398,7 +402,7 @@
             printf("%sdebug: state %d, shifting to state %d\n",
                     YYPREFIX, yystate, yytable[yyn]);
 #endif
-        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOM
EM)
         {
             goto yyoverflow;
         }
@@ -417,7 +421,7 @@
     }
     if (yyerrflag) goto yyinrecovery;

-    yyerror("syntax error");
+    YYERROR_CALL("syntax error");

     goto yyerrlab;

@@ -438,7 +442,7 @@
                     printf("%sdebug: state %d, error recovery shifting\
  to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
 #endif
-                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) =
= YYENOMEM)
                 {
                     goto yyoverflow;
                 }
@@ -462,7 +466,7 @@
     }
     else
     {
-        if (yychar == 0) goto yyabort;
+        if (yychar == YYEOF) goto yyabort;
 #if YYDEBUG
         if (yydebug)
         {
@@ -548,7 +552,7 @@
 #line 70 "quote_calc2.y"
        {  yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
 break;
-#line 550 "/dev/stdout"
+#line 556 "/dev/stdout"
     }
     yystack.s_mark -= yym;
     yystate = *yystack.s_mark;
@@ -566,7 +570,7 @@
         *++yystack.l_mark = yyval;
         if (yychar < 0)
         {
-            if ((yychar = YYLEX) < 0) yychar = 0;
+            if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
             if (yydebug)
             {
@@ -576,7 +580,7 @@
             }
 #endif
         }
-        if (yychar == 0) goto yyaccept;
+        if (yychar == YYEOF) goto yyaccept;
         goto yyloop;
     }
     if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
@@ -589,16 +593,16 @@
         printf("%sdebug: after reduction, shifting from state %d \
 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
 #endif
-    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
     {
         goto yyoverflow;
     }
-    *++yystack.s_mark = (short) yystate;
+    *++yystack.s_mark = (YYINT) yystate;
     *++yystack.l_mark = yyval;
     goto yyloop;

 yyoverflow:
-    yyerror("yacc stack overflow");
+    YYERROR_CALL("yacc stack overflow");

 yyabort:
     yyfreestack(&yystack);
not ok - 12 # Test failed: regression detected.  See above. (in .)
--- /usr/tests/usr.bin/yacc/regress.13.out      2014-12-02 08:00:18.000000000 +0
000
+++ -   2014-12-03 01:07:29.587226268 +0000
@@ -1,17 +1,17 @@
-#ifndef lint
-static const char yysccsid[] = "@(#)yaccpar    1.9 (Berkeley) 02/21/93";
-#endif
+/* original parser id follows */
+/* yysccsid[] = "@(#)yaccpar   1.9 (Berkeley) 02/21/93" */
+/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */

 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
-#define YYPATCH 20140101

 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
 #define yyerrok        (yyerrflag = 0)
 #define YYRECOVERING() (yyerrflag != 0)
-
+#define YYENOMEM       (-2)
+#define YYEOF          0
 #define YYPREFIX "yy"

 #define YYPURE 0
@@ -26,10 +26,12 @@
 int yylex(void);
 static void yyerror(const char *s);

-#line 29 "/dev/stdout"
+#line 30 "/dev/stdout"

-#ifndef YYSTYPE
+#if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
+/* Default: YYSTYPE is the semantic value type. */
 typedef int YYSTYPE;
+# define YYSTYPE_IS_DECLARED 1
 #endif

 /* compatibility with bison */
@@ -73,40 +75,41 @@
 #define LETTER 270
 #define UMINUS 271
 #define YYERRCODE 256
-static const short yylhs[] = {                           -1,
+typedef short YYINT;
+static const YYINT yylhs[] = {                           -1,
     0,    0,    0,    1,    1,    2,    2,    2,    2,    2,
     2,    2,    2,    2,    2,    2,    3,    3,
 };
-static const short yylen[] = {                            2,
+static const YYINT yylen[] = {                            2,
     0,    3,    3,    1,    3,    3,    3,    3,    3,    3,
     3,    3,    3,    2,    1,    1,    1,    2,
 };
-static const short yydefred[] = {                         1,
+static const YYINT yydefred[] = {                         1,
     0,    0,    0,   17,    0,    0,    0,    0,    0,    3,
    15,    0,    0,    0,    2,    0,    0,    0,    0,    0,
     0,    0,   18,    0,    6,    0,    0,    0,    0,    0,
     0,    0,
 };
-static const short yydgoto[] = {                          1,
+static const YYINT yydgoto[] = {                          1,
     7,    8,    9,
 };
-static const short yysindex[] = {                         0,
+static const YYINT yysindex[] = {                         0,
   -38,    5,  -36,    0,  -51,  -36,    7, -121, -248,    0,
     0, -243,  -36,  -22,    0,  -36,  -36,  -36,  -36,  -36,
   -36,  -36,    0, -121,    0, -121, -121, -121, -121, -121,
  -121, -243,
 };
-static const short yyrindex[] = {                         0,
+static const YYINT yyrindex[] = {                         0,
     0,    0,    0,    0,   -9,    0,    0,   13,  -10,    0,
     0,   -5,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,   15,    0,   -3,   -2,   -1,    1,    2,
     3,   -4,
 };
-static const short yygindex[] = {                         0,
+static const YYINT yygindex[] = {                         0,
     0,   42,    0,
 };
 #define YYTABLESIZE 258
-static const short yytable[] = {                         16,
+static const YYINT yytable[] = {                         16,
    15,    6,   22,    6,   14,   13,    7,    8,    9,   13,
    10,   11,   12,   16,   10,   17,   15,   18,   25,   19,
    23,   20,    4,   21,    5,    0,    0,    0,    0,    0,
@@ -134,7 +137,7 @@
    19,    0,   20,    0,   21,    0,   16,   15,   16,   15,
    16,   15,   16,   15,   16,   15,   16,   15,
 };
-static const short yycheck[] = {                         10,
+static const YYINT yycheck[] = {                         10,
    10,   40,  124,   40,   10,   10,   10,   10,   10,   61,
    10,   10,   10,  257,   10,  259,   10,  261,   41,  263,
   269,  265,   10,  267,   10,   -1,   -1,   -1,   -1,   -1,
@@ -167,9 +170,10 @@
 #define YYDEBUG 0
 #endif
 #define YYMAXTOKEN 271
-#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
+#define YYUNDFTOKEN 277
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
 #if YYDEBUG
-static const char *yyname[] = {
+static const char *const yyname[] = {

 "end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0
,
@@ -180,9 +184,10 @@
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,"OP_ADD","\"ADD-operator\"","OP_SUB","\"SUB-operator\"","OP_MUL",
 "\"MUL-operator\"","OP_DIV","\"DIV-operator\"","OP_MOD","\"MOD-operator\"",
-"OP_AND","\"AND-operator\"","DIGIT","LETTER","UMINUS","illegal-symbol",
+"OP_AND","\"AND-operator\"","DIGIT","LETTER","UMINUS",0,0,0,0,0,
+"illegal-symbol",
 };
-static const char *yyrule[] = {
+static const char *const yyrule[] = {
 "$accept : list",
 "list :",
 "list : list stat '\\n'",
@@ -231,9 +236,9 @@

 typedef struct {
     unsigned stacksize;
-    short    *s_base;
-    short    *s_mark;
-    short    *s_last;
+    YYINT    *s_base;
+    YYINT    *s_mark;
+    YYINT    *s_last;
     YYSTYPE  *l_base;
     YYSTYPE  *l_mark;
 } YYSTACKDATA;
@@ -280,7 +285,7 @@
     }
     return( c );
 }
-#line 282 "/dev/stdout"
+#line 289 "/dev/stdout"

 #if YYDEBUG
 #include               /* needed for printf */
@@ -294,27 +299,27 @@
 {
     int i;
     unsigned newsize;
-    short *newss;
+    YYINT *newss;
     YYSTYPE *newvs;

     if ((newsize = data->stacksize) == 0)
         newsize = YYINITSTACKSIZE;
     else if (newsize >= YYMAXDEPTH)
-        return -1;
+        return YYENOMEM;
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;

     i = (int) (data->s_mark - data->s_base);
-    newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
+    newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
-        return -1;
+        return YYENOMEM;

     data->s_base = newss;
     data->s_mark = newss + i;

     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
     if (newvs == 0)
-        return -1;
+        return YYENOMEM;

     data->l_base = newvs;
     data->l_mark = newvs + i;
@@ -364,7 +369,7 @@
     memset(&yystack, 0, sizeof(yystack));
 #endif

-    if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
+    if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyove
rflow;
     yystack.s_mark = yystack.s_base;
     yystack.l_mark = yystack.l_base;
     yystate = 0;
@@ -374,7 +379,7 @@
     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
     if (yychar < 0)
     {
-        if ((yychar = YYLEX) < 0) yychar = 0;
+        if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
         if (yydebug)
         {
@@ -392,7 +397,7 @@
             printf("%sdebug: state %d, shifting to state %d\n",
                     YYPREFIX, yystate, yytable[yyn]);
 #endif
-        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOM
EM)
         {
             goto yyoverflow;
         }
@@ -411,7 +416,7 @@
     }
     if (yyerrflag) goto yyinrecovery;

-    yyerror("syntax error");
+    YYERROR_CALL("syntax error");

     goto yyerrlab;

@@ -432,7 +437,7 @@
                     printf("%sdebug: state %d, error recovery shifting\
  to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
 #endif
-                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) =
= YYENOMEM)
                 {
                     goto yyoverflow;
                 }
@@ -456,7 +461,7 @@
     }
     else
     {
-        if (yychar == 0) goto yyabort;
+        if (yychar == YYEOF) goto yyabort;
 #if YYDEBUG
         if (yydebug)
         {
@@ -542,7 +547,7 @@
 #line 70 "quote_calc3.y"
        {  yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
 break;
-#line 544 "/dev/stdout"
+#line 551 "/dev/stdout"
     }
     yystack.s_mark -= yym;
     yystate = *yystack.s_mark;
@@ -560,7 +565,7 @@
         *++yystack.l_mark = yyval;
         if (yychar < 0)
         {
-            if ((yychar = YYLEX) < 0) yychar = 0;
+            if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
             if (yydebug)
             {
@@ -570,7 +575,7 @@
             }
 #endif
         }
-        if (yychar == 0) goto yyaccept;
+        if (yychar == YYEOF) goto yyaccept;
         goto yyloop;
     }
     if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
@@ -583,16 +588,16 @@
         printf("%sdebug: after reduction, shifting from state %d \
 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
 #endif
-    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
     {
         goto yyoverflow;
     }
-    *++yystack.s_mark = (short) yystate;
+    *++yystack.s_mark = (YYINT) yystate;
     *++yystack.l_mark = yyval;
     goto yyloop;

 yyoverflow:
-    yyerror("yacc stack overflow");
+    YYERROR_CALL("yacc stack overflow");

 yyabort:
     yyfreestack(&yystack);
not ok - 13 # Test failed: regression detected.  See above. (in .)
--- /usr/tests/usr.bin/yacc/regress.14.out      2014-12-02 08:00:18.000000000 +0
000
+++ -   2014-12-03 01:07:29.593863568 +0000
@@ -1,17 +1,17 @@
-#ifndef lint
-static const char yysccsid[] = "@(#)yaccpar    1.9 (Berkeley) 02/21/93";
-#endif
+/* original parser id follows */
+/* yysccsid[] = "@(#)yaccpar   1.9 (Berkeley) 02/21/93" */
+/* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */

 #define YYBYACC 1
 #define YYMAJOR 1
 #define YYMINOR 9
-#define YYPATCH 20140101

 #define YYEMPTY        (-1)
 #define yyclearin      (yychar = YYEMPTY)
 #define yyerrok        (yyerrflag = 0)
 #define YYRECOVERING() (yyerrflag != 0)
-
+#define YYENOMEM       (-2)
+#define YYEOF          0
 #define YYPREFIX "yy"

 #define YYPURE 0
@@ -26,10 +26,12 @@
 int yylex(void);
 static void yyerror(const char *s);

-#line 29 "/dev/stdout"
+#line 30 "/dev/stdout"

-#ifndef YYSTYPE
+#if ! defined(YYSTYPE) && ! defined(YYSTYPE_IS_DECLARED)
+/* Default: YYSTYPE is the semantic value type. */
 typedef int YYSTYPE;
+# define YYSTYPE_IS_DECLARED 1
 #endif

 /* compatibility with bison */
@@ -73,40 +75,41 @@
 #define LETTER 270
 #define UMINUS 271
 #define YYERRCODE 256
-static const short yylhs[] = {                           -1,
+typedef short YYINT;
+static const YYINT yylhs[] = {                           -1,
     0,    0,    0,    1,    1,    2,    2,    2,    2,    2,
     2,    2,    2,    2,    2,    2,    3,    3,
 };
-static const short yylen[] = {                            2,
+static const YYINT yylen[] = {                            2,
     0,    3,    3,    1,    3,    3,    3,    3,    3,    3,
     3,    3,    3,    2,    1,    1,    1,    2,
 };
-static const short yydefred[] = {                         1,
+static const YYINT yydefred[] = {                         1,
     0,    0,    0,   17,    0,    0,    0,    0,    0,    3,
    15,    0,    0,    0,    2,    0,    0,    0,    0,    0,
     0,    0,   18,    0,    6,    0,    0,    0,    0,    0,
     0,    0,
 };
-static const short yydgoto[] = {                          1,
+static const YYINT yydgoto[] = {                          1,
     7,    8,    9,
 };
-static const short yysindex[] = {                         0,
+static const YYINT yysindex[] = {                         0,
   -38,    4,  -36,    0,  -51,  -36,    6, -121, -249,    0,
     0, -243,  -36,  -23,    0,  -36,  -36,  -36,  -36,  -36,
   -36,  -36,    0, -121,    0, -121, -121, -121, -121, -121,
  -121, -243,
 };
-static const short yyrindex[] = {                         0,
+static const YYINT yyrindex[] = {                         0,
     0,    0,    0,    0,   -9,    0,    0,   12,  -10,    0,
     0,   -5,    0,    0,    0,    0,    0,    0,    0,    0,
     0,    0,    0,   14,    0,   -3,   -2,   -1,    1,    2,
     3,   -4,
 };
-static const short yygindex[] = {                         0,
+static const YYINT yygindex[] = {                         0,
     0,   42,    0,
 };
 #define YYTABLESIZE 259
-static const short yytable[] = {                         16,
+static const YYINT yytable[] = {                         16,
    15,    6,   22,    6,   14,   13,    7,    8,    9,   13,
    10,   11,   12,   10,   16,   15,   17,   25,   18,   23,
    19,    4,   20,    5,   21,    0,    0,    0,    0,    0,
@@ -134,7 +137,7 @@
    19,    0,   20,    0,   21,    0,    0,   16,   15,   16,
    15,   16,   15,   16,   15,   16,   15,   16,   15,
 };
-static const short yycheck[] = {                         10,
+static const YYINT yycheck[] = {                         10,
    10,   40,  124,   40,   10,   10,   10,   10,   10,   61,
    10,   10,   10,   10,  258,   10,  260,   41,  262,  269,
   264,   10,  266,   10,  268,   -1,   -1,   -1,   -1,   -1,
@@ -167,9 +170,10 @@
 #define YYDEBUG 0
 #endif
 #define YYMAXTOKEN 271
-#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a))
+#define YYUNDFTOKEN 277
+#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
 #if YYDEBUG
-static const char *yyname[] = {
+static const char *const yyname[] = {

 "end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,"'%'","'&'",0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0
,
@@ -180,9 +184,10 @@
 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
,
 0,0,0,0,0,0,"OP_ADD","\"ADD-operator\"","OP_SUB","\"SUB-operator\"","OP_MUL",
 "\"MUL-operator\"","OP_DIV","\"DIV-operator\"","OP_MOD","\"MOD-operator\"",
-"OP_AND","\"AND-operator\"","DIGIT","LETTER","UMINUS","illegal-symbol",
+"OP_AND","\"AND-operator\"","DIGIT","LETTER","UMINUS",0,0,0,0,0,
+"illegal-symbol",
 };
-static const char *yyrule[] = {
+static const char *const yyrule[] = {
 "$accept : list",
 "list :",
 "list : list stat '\\n'",
@@ -231,9 +236,9 @@

 typedef struct {
     unsigned stacksize;
-    short    *s_base;
-    short    *s_mark;
-    short    *s_last;
+    YYINT    *s_base;
+    YYINT    *s_mark;
+    YYINT    *s_last;
     YYSTYPE  *l_base;
     YYSTYPE  *l_mark;
 } YYSTACKDATA;
@@ -280,7 +285,7 @@
     }
     return( c );
 }
-#line 282 "/dev/stdout"
+#line 289 "/dev/stdout"

 #if YYDEBUG
 #include               /* needed for printf */
@@ -294,27 +299,27 @@
 {
     int i;
     unsigned newsize;
-    short *newss;
+    YYINT *newss;
     YYSTYPE *newvs;

     if ((newsize = data->stacksize) == 0)
         newsize = YYINITSTACKSIZE;
     else if (newsize >= YYMAXDEPTH)
-        return -1;
+        return YYENOMEM;
     else if ((newsize *= 2) > YYMAXDEPTH)
         newsize = YYMAXDEPTH;

     i = (int) (data->s_mark - data->s_base);
-    newss = (short *)realloc(data->s_base, newsize * sizeof(*newss));
+    newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
     if (newss == 0)
-        return -1;
+        return YYENOMEM;

     data->s_base = newss;
     data->s_mark = newss + i;

     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
     if (newvs == 0)
-        return -1;
+        return YYENOMEM;

     data->l_base = newvs;
     data->l_mark = newvs + i;
@@ -364,7 +369,7 @@
     memset(&yystack, 0, sizeof(yystack));
 #endif

-    if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow;
+    if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyove
rflow;
     yystack.s_mark = yystack.s_base;
     yystack.l_mark = yystack.l_base;
     yystate = 0;
@@ -374,7 +379,7 @@
     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
     if (yychar < 0)
     {
-        if ((yychar = YYLEX) < 0) yychar = 0;
+        if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
         if (yydebug)
         {
@@ -392,7 +397,7 @@
             printf("%sdebug: state %d, shifting to state %d\n",
                     YYPREFIX, yystate, yytable[yyn]);
 #endif
-        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+        if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOM
EM)
         {
             goto yyoverflow;
         }
@@ -411,7 +416,7 @@
     }
     if (yyerrflag) goto yyinrecovery;

-    yyerror("syntax error");
+    YYERROR_CALL("syntax error");

     goto yyerrlab;

@@ -432,7 +437,7 @@
                     printf("%sdebug: state %d, error recovery shifting\
  to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
 #endif
-                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+                if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) =
= YYENOMEM)
                 {
                     goto yyoverflow;
                 }
@@ -456,7 +461,7 @@
     }
     else
     {
-        if (yychar == 0) goto yyabort;
+        if (yychar == YYEOF) goto yyabort;
 #if YYDEBUG
         if (yydebug)
         {
@@ -542,7 +547,7 @@
 #line 70 "quote_calc4.y"
        {  yyval = base * yystack.l_mark[-1] + yystack.l_mark[0]; }
 break;
-#line 544 "/dev/stdout"
+#line 551 "/dev/stdout"
     }
     yystack.s_mark -= yym;
     yystate = *yystack.s_mark;
@@ -560,7 +565,7 @@
         *++yystack.l_mark = yyval;
         if (yychar < 0)
         {
-            if ((yychar = YYLEX) < 0) yychar = 0;
+            if ((yychar = YYLEX) < 0) yychar = YYEOF;
 #if YYDEBUG
             if (yydebug)
             {
@@ -570,7 +575,7 @@
             }
 #endif
         }
-        if (yychar == 0) goto yyaccept;
+        if (yychar == YYEOF) goto yyaccept;
         goto yyloop;
     }
     if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
@@ -583,16 +588,16 @@
         printf("%sdebug: after reduction, shifting from state %d \
 to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
 #endif
-    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack))
+    if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
     {
         goto yyoverflow;
     }
-    *++yystack.s_mark = (short) yystate;
+    *++yystack.s_mark = (YYINT) yystate;
     *++yystack.l_mark = yyval;
     goto yyloop;

 yyoverflow:
-    yyerror("yacc stack overflow");
+    YYERROR_CALL("yacc stack overflow");

 yyabort:
     yyfreestack(&yystack);
not ok - 14 # Test failed: regression detected.  See above. (in .)

Standard error

yacc: w - line 5 of "/usr/tests/usr.bin/yacc/undefined.y", the default action as
signs an undefined value to $$
yacc: 2 rules never reduced
yacc: 18 shift/reduce conflicts, 26 reduce/reduce conflicts.
yacc: 1 shift/reduce conflict, 29 reduce/reduce conflicts.
yacc: 54 shift/reduce conflicts.
yacc: 54 shift/reduce conflicts.
yacc: 54 shift/reduce conflicts.
yacc: 54 shift/reduce conflicts.

References

   1. file:///tmp/context.html
