From: Joel E. Denny Date: Sat, 16 Apr 2011 22:15:40 +0000 (-0400) Subject: glr.c: omit yyresolveLocations when locations are disabled. X-Git-Tag: v2.5_rc1~5 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/55dd35633675f588c58ead46ecd6b5f4db504192?ds=inline glr.c: omit yyresolveLocations when locations are disabled. This prevents gcc 4.6.0's -Wunused-but-set-variable from warning about yyresolveLocations's local yyrhsloc. When locations are enabled, there's no such warning because YYLLOC_DEFAULT then uses yyrhsloc. Reported by Jim Meyering at . * data/glr.c (yyresolveLocations): Omit definition when locations are disabled. (yyresolveValue): Omit yyresolveLocations invocation when locations are disabled. --- diff --git a/ChangeLog b/ChangeLog index 70ee0043..4c63cb19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2011-04-16 Joel E. Denny + + glr.c: omit yyresolveLocations when locations are disabled. + This prevents gcc 4.6.0's -Wunused-but-set-variable from warning + about yyresolveLocations's local yyrhsloc. When locations are + enabled, there's no such warning because YYLLOC_DEFAULT then uses + yyrhsloc. Reported by Jim Meyering at + . + * data/glr.c (yyresolveLocations): Omit definition when locations + are disabled. + (yyresolveValue): Omit yyresolveLocations invocation when + locations are disabled. + 2011-04-16 Joel E. Denny gnulib, autoconf: update. diff --git a/data/glr.c b/data/glr.c index 6829ca37..df902019 100644 --- a/data/glr.c +++ b/data/glr.c @@ -1802,7 +1802,7 @@ yyreportAmbiguity (yySemanticOption* yyx0, yyerror (]b4_yyerror_args[YY_("syntax is ambiguous")); return yyabort; -} +}]b4_locations_if([[ /** Starting at and including state S1, resolve the location for each of the * previous N1 states that is unresolved. The first semantic option of a state @@ -1860,7 +1860,7 @@ yyresolveLocations (yyGLRState* yys1, int yyn1, yylloc = yylloc_current; } } -} +}]])[ /** Resolve the ambiguity represented in state S, perform the indicated * actions, and set the semantic value of S. If result != yyok, the chain of @@ -1894,8 +1894,8 @@ yyresolveValue (yyGLRState* yys, yyGLRStack* yystackp]b4_user_formals[) { switch (yypreference (yybest, yyp)) { - case 0: - yyresolveLocations (yys, 1, yystackp]b4_user_args[); + case 0:]b4_locations_if([[ + yyresolveLocations (yys, 1, yystackp]b4_user_args[);]])[ return yyreportAmbiguity (yybest, yyp]b4_pure_args[); break; case 1: