From 06caf0e144948affb940c323800a87c28dae467b Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Tue, 15 Dec 2009 22:03:18 -0600 Subject: [PATCH] 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. (cherry picked from commit ae93128c9671b58bdc2b557c382ecd84e659ab52) --- ChangeLog | 8 ++++++++ data/glr.c | 4 ++-- data/lalr1.cc | 2 +- data/yacc.c | 6 +++--- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index e13bde96..6ecdb525 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-12-15 Jonathan Nieder (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 autoconf: update to latest for fix of M4 detection. diff --git a/data/glr.c b/data/glr.c index ab5f9d62..69bfef86 100644 --- a/data/glr.c +++ b/data/glr.c @@ -248,7 +248,7 @@ b4_percent_code_get[]dnl #include #ifndef YY_ -# if YYENABLE_NLS +# if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) @@ -2321,7 +2321,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 diff --git a/data/lalr1.cc b/data/lalr1.cc index e681ba6b..c36ba3de 100644 --- a/data/lalr1.cc +++ b/data/lalr1.cc @@ -326,7 +326,7 @@ b4_defines_if([[ b4_percent_code_get[]dnl [#ifndef YY_ -# if YYENABLE_NLS +# if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* FIXME: INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) diff --git a/data/yacc.c b/data/yacc.c index 5fb01700..bce868e9 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -373,7 +373,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 /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) @@ -736,7 +736,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, \ @@ -1258,7 +1258,7 @@ b4_c_function_def([[yyparse]], [[int]], b4_parse_param)[ 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[; -- 2.45.2