bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

data/yacc.c: patch to avoid warning about yytoknum being unused.


From: Jim Meyering
Subject: data/yacc.c: patch to avoid warning about yytoknum being unused.
Date: Sat, 31 Aug 2002 11:01:01 +0200
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu)

Hi!

Without this change, I get a warning (in the bison-generated
coreutils/lib/getdate.c) about yytoknum being unused.

        * data/yacc.c: Guard the declaration of yytoknum also with
        `#ifdef YYPRINT', so it is declared only when used.

Index: data/yacc.c
===================================================================
RCS file: /cvs/bison/data/yacc.c,v
retrieving revision 1.12
diff -u -p -u -p -r1.12 yacc.c
--- data/yacc.c 12 Aug 2002 15:04:54 -0000      1.12
+++ data/yacc.c 31 Aug 2002 08:53:15 -0000
@@ -358,12 +358,14 @@ static const char *const yytname[[]] =
 };
 #endif
 
+# ifdef YYPRINT
 /* YYTOKNUM[[YYLEX-NUM]] -- Internal token number corresponding to
    token YYLEX-NUM.  */
 static const b4_int_type_for([b4_toknum]) yytoknum[[]] =
 {
   b4_toknum
 };
+# endif
 
 /* YYR1[[YYN]] -- Symbol number of symbol that rule YYN derives.  */
 static const b4_int_type_for([b4_r1]) yyr1[[]] =




reply via email to

[Prev in Thread] Current Thread [Next in Thread]