From b1efe548af4f7f27fa5fccba0568a946159d9194 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 28 Dec 2002 09:02:18 +0000 Subject: [PATCH] Fix a bug where error locations were not being recorded correctly. Warn if we detect conflicting outputs to the same file. If the user specifies "%expect N", report an error if there are any reduce/reduce conflicts. --- ChangeLog | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/ChangeLog b/ChangeLog index da8ceadc..3348b80f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,39 @@ +2002-12-27 Paul Eggert + + Fix a bug where error locations were not being recorded correctly. + This problem was originally reported by Paul Hilfinger in + . + + * data/yacc.c (yyparse): New local var yylerrsp, to record the + top of the location stack's error locations. + (yyerrlab): Set it. When discarding a token, push its location + onto yylerrsp so that we don't lose track of the error's end. + (yyerrlab1): Now is only the target of YYERROR, so that we can + properly record the location of the action that failed. For GCC + 2.93 and later, insert an __attribute__ ((__unused__)) to avoid + GCC warning about yyerrlab1 being unused if YYERROR is unused. + (yyerrlab2): New label, which yyerrlab now falls through to. + Compute the error's location by applying YYLLOC_DEFAULT to + the locations of all the symbols that went into the error. + * doc/bison.texinfo (Location Default Action): Mention that + YYLLOC_DEFAULT is also invoked for syntax errors. + * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): + Error locations include the locations of all the tokens that were + discarded, not just the last token. + 2002-12-26 Paul Eggert + * src/files.c: Include quote.h. + (compute_output_file_names): Warn if we detect conflicting + outputs to the same file. This should catch the misunderstanding + exemplified by Debian Bug 165349, reported by Bruce Stephens.. + + * src/conflicts.c (conflicts_print): If the user specifies + "%expect N", report an error if there are any reduce/reduce + conflicts. This is what the manual says should happen. + This fixes Debian bug 130890, reported by Anthony DeRobertis. + * tests/conflicts.at (%expect with reduce conflicts): New test. + Don't use m4_include on relative file names, as it doesn't work as desired if there happens to be a file with that name under ".". -- 2.45.2