]> git.saurik.com Git - bison.git/commitdiff
Avoid warnings from gcc -Wundef y.tab.c.
authorJonathan Nieder <jrnieder@gmail.com>
Wed, 16 Dec 2009 04:03:18 +0000 (22:03 -0600)
committerJoel E. Denny <jdenny@clemson.edu>
Wed, 16 Dec 2009 06:58:21 +0000 (01:58 -0500)
* data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
defined before using them.
* data/lalr1.cc: Likewise.
* data/yacc.c: Likewise.
(cherry picked from commit ae93128c9671b58bdc2b557c382ecd84e659ab52)

ChangeLog
data/glr.c
data/lalr1.cc
data/yacc.c

index d419d50415776e730bdef8faabde78f6a07f431a..b748ac4aa62799625314ad568d932b2090171b8f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-12-15  Jonathan Nieder  <jrnieder@gmail.com>  (tiny change)
+
+       Avoid warnings from gcc -Wundef y.tab.c.
+       * data/glr.c: Check if YYENABLE_NLS and YYLTYPE_IS_TRIVIAL are
+       defined before using them.
+       * data/lalr1.cc: Likewise.
+       * data/yacc.c: Likewise.
+
 2009-12-15  Joel E. Denny  <jdenny@clemson.edu>
 
        Import M4 detection fix from Autoconf.
index f458adc263ef00915fd59583942838037f18699f..ec483fb1aaf24621aeb5feb20d1a469dc4f62751 100644 (file)
@@ -248,7 +248,7 @@ b4_percent_code_get[]dnl
 #include <string.h>
 
 #ifndef YY_
-# if YYENABLE_NLS
+# if defined YYENABLE_NLS && YYENABLE_NLS
 #  if ENABLE_NLS
 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -2323,7 +2323,7 @@ yyrecoverSyntaxError (yyGLRStack* yystackp]b4_user_formals[)
   yychar = YYEMPTY;
   yylval = yyval_default;
 ]b4_locations_if([
-#if YYLTYPE_IS_TRIVIAL
+#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
   yylloc.first_line   = yylloc.last_line   = ]b4_location_initial_line[;
   yylloc.first_column = yylloc.last_column = ]b4_location_initial_column[;
 #endif
index 04bd54a9971d6f41e5d3656bd46ff6633c67c384..7db05fee9b1dbfa2078a9b0d48c1ed2d11767efe 100644 (file)
@@ -318,7 +318,7 @@ b4_defines_if([[
 b4_percent_code_get[]dnl
 
 [#ifndef YY_
-# if YYENABLE_NLS
+# if defined YYENABLE_NLS && YYENABLE_NLS
 #  if ENABLE_NLS
 #   include <libintl.h> /* FIXME: INFRINGES ON USER NAME SPACE */
 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
index 68db6a98440a10e151728a763ed78b27b8213305..bc942ec6fa2ec8df9c861460b2855eeb522db624 100644 (file)
@@ -311,7 +311,7 @@ typedef short int yytype_int16;
 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
 
 #ifndef YY_
-# if YYENABLE_NLS
+# if defined YYENABLE_NLS && YYENABLE_NLS
 #  if ENABLE_NLS
 #   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
 #   define YY_(msgid) dgettext ("bison-runtime", msgid)
@@ -669,7 +669,7 @@ while (YYID (0))
    we won't break user code: when these are the locations we know.  */
 
 #ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
 #  define YY_LOCATION_PRINT(File, Loc)                 \
      fprintf (File, "%d.%d-%d.%d",                     \
              (Loc).first_line, (Loc).first_column,     \
@@ -1235,7 +1235,7 @@ b4_push_if([b4_pure_if([], [[  int yypushed_char = yychar;
   yyvsp = yyvs;]b4_locations_if([[
   yylsp = yyls;
 
-#if YYLTYPE_IS_TRIVIAL
+#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
   /* Initialize the default location before parsing starts.  */
   yylloc.first_line   = yylloc.last_line   = ]b4_location_initial_line[;
   yylloc.first_column = yylloc.last_column = ]b4_location_initial_column[;