From 874ac415b95e9c98ab33dec4b33755d989986261 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Tue, 15 Dec 2009 22:07:46 -0600 Subject: [PATCH] Simplify y.tab.c when location tracking is disabled. * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location tracking is not enabled. Instead, unconditionally define YY_LOCATION_PRINT as a no-op for backward compatibility. (cherry picked from commit fcd32abd3a4b68ef525d7766dbed1c98465e23b9) --- ChangeLog | 7 +++++++ data/yacc.c | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6ecdb525..e8c7b874 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-12-15 Jonathan Nieder (tiny change) + + Simplify y.tab.c when location tracking is disabled. + * data/yacc.c: Do not check YYLTYPE_IS_TRIVIAL if location + tracking is not enabled. Instead, unconditionally define + YY_LOCATION_PRINT as a no-op for backward compatibility. + 2009-12-15 Jonathan Nieder (tiny change) Avoid warnings from gcc -Wundef y.tab.c. diff --git a/data/yacc.c b/data/yacc.c index bce868e9..a9815eee 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -730,7 +730,7 @@ while (YYID (0)) while (YYID (0)) #endif - +]b4_locations_if([[ /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ @@ -745,7 +745,13 @@ while (YYID (0)) # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif +]], [[ +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif +]])[ /* YYLEX -- calling `yylex' with the right arguments. */ -- 2.45.2