From d8ce7031024f463a8ba96fc7b2a75facdc52ecb9 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Mon, 22 Apr 2013 11:26:28 +0200 Subject: [PATCH] diagnostics: use appropriate location for useless precedence/associativity * src/symtab.c (symbol_precedence_set): Use prec_location, not location (which is the first occurrence of the symbol, possibly just %token). Also, as redefinitions are not allowed, keep the first values, not the subsequent ones. * tests/conflicts.at, tests/existing.at, tests/regression.at: Adjust. --- src/symtab.c | 17 ++-- tests/conflicts.at | 37 ++++---- tests/existing.at | 210 ++++++++++++++++++++++---------------------- tests/regression.at | 8 +- 4 files changed, 138 insertions(+), 134 deletions(-) diff --git a/src/symtab.c b/src/symtab.c index b132e07b..11a0d756 100644 --- a/src/symtab.c +++ b/src/symtab.c @@ -321,12 +321,15 @@ symbol_precedence_set (symbol *sym, int prec, assoc a, location loc) { if (a != undef_assoc) { - if (sym->prec != 0) + if (sym->prec) symbol_redeclaration (sym, assoc_to_string (a), sym->prec_location, loc); - sym->prec = prec; - sym->assoc = a; - sym->prec_location = loc; + else + { + sym->prec = prec; + sym->assoc = a; + sym->prec_location = loc; + } } /* Only terminals have a precedence. */ @@ -1153,14 +1156,14 @@ print_precedence_warnings (void) && !prec_nodes[i]->succ) { if (is_assoc_useless (s)) - complain (&s->location, Wprecedence, + complain (&s->prec_location, Wprecedence, _("useless precedence and associativity for %s"), s->tag); else if (s->assoc == precedence_assoc) - complain (&s->location, Wprecedence, + complain (&s->prec_location, Wprecedence, _("useless precedence for %s"), s->tag); } else if (is_assoc_useless (s)) - complain (&s->location, Wprecedence, + complain (&s->prec_location, Wprecedence, _("useless associativity for %s, use %%precedence"), s->tag); } free (used_assoc); diff --git a/tests/conflicts.at b/tests/conflicts.at index 2d67a358..bbb3f89d 100644 --- a/tests/conflicts.at +++ b/tests/conflicts.at @@ -180,7 +180,8 @@ AT_CLEANUP AT_SETUP([Useless associativity warning]) AT_DATA([[input.y]], -[[%nonassoc "=" +[[%token EQ "=" PL "+" ST "*" LP "(" +%nonassoc "=" %left "+" %left "*" %precedence "(" @@ -199,9 +200,9 @@ exp: ]]) AT_BISON_CHECK([-Wprecedence input.y], 0, [], -[[input.y:1.11-13: warning: useless precedence and associativity for "=" [-Wprecedence] -input.y:3.7-9: warning: useless associativity for "*", use %precedence [-Wprecedence] -input.y:4.13-15: warning: useless precedence for "(" [-Wprecedence] +[[input.y:2.1-9: warning: useless precedence and associativity for "=" [-Wprecedence] +input.y:4.1-5: warning: useless associativity for "*", use %precedence [-Wprecedence] +input.y:5.1-11: warning: useless precedence for "(" [-Wprecedence] ]]) AT_CLEANUP @@ -214,7 +215,7 @@ AT_CLEANUP AT_SETUP([Useless precedence warning]) AT_DATA([[input.y]], -[[%token A B +[[%token A B U V W X Y Z %precedence Z %left X %precedence Y @@ -242,18 +243,18 @@ f: B ]]) AT_BISON_CHECK([-Wprecedence -fcaret -o input.c input.y], 0, [], -[[input.y:2.13: warning: useless precedence for Z [-Wprecedence] - %precedence Z - ^ -input.y:5.7: warning: useless precedence and associativity for W [-Wprecedence] - %left W - ^ -input.y:6.8: warning: useless precedence and associativity for V [-Wprecedence] - %right V - ^ -input.y:7.11: warning: useless precedence and associativity for U [-Wprecedence] +[[input.y:7.1-9: warning: useless precedence and associativity for U [-Wprecedence] %nonassoc U - ^ + ^^^^^^^^^ +input.y:6.1-6: warning: useless precedence and associativity for V [-Wprecedence] + %right V + ^^^^^^ +input.y:5.1-5: warning: useless precedence and associativity for W [-Wprecedence] + %left W + ^^^^^ +input.y:2.1-11: warning: useless precedence for Z [-Wprecedence] + %precedence Z + ^^^^^^^^^^^ ]]) AT_CLEANUP @@ -1265,8 +1266,8 @@ e: e '+' e AT_BISON_CHECK([-Wall -o input.c input.y], 0, [], [[input.y: warning: 4 shift/reduce conflicts [-Wconflicts-sr] -input.y:1.7-9: warning: useless precedence and associativity for '+' [-Wprecedence] -input.y:2.7-9: warning: useless precedence and associativity for '*' [-Wprecedence] +input.y:1.1-5: warning: useless precedence and associativity for '+' [-Wprecedence] +input.y:2.1-5: warning: useless precedence and associativity for '*' [-Wprecedence] ]]) AT_CLEANUP diff --git a/tests/existing.at b/tests/existing.at index 1fd1333f..a1b95ac9 100644 --- a/tests/existing.at +++ b/tests/existing.at @@ -439,24 +439,24 @@ input.y:322.9: warning: empty rule without %empty [-Wempty-rule] ]AT_COND_CASE([[canonical LR]], [[input.y: warning: 265 shift/reduce conflicts [-Wconflicts-sr]]], [[input.y: warning: 65 shift/reduce conflicts [-Wconflicts-sr]]])[ -input.y:19.8-16: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence] -input.y:21.8-14: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence] -input.y:21.16-22: warning: useless associativity for YSTRING, use %precedence [-Wprecedence] -input.y:22.14-22: warning: useless precedence and associativity for APPEND_OP [-Wprecedence] -input.y:23.8-15: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence] -input.y:23.33-41: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence] -input.y:27.8-18: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence] -input.y:28.8-13: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence] -input.y:29.23-31: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence] -input.y:29.33-41: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence] -input.y:30.8-18: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence] -input.y:30.20-29: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence] -input.y:40.11-13: warning: useless precedence and associativity for ',' [-Wprecedence] -input.y:47.8-10: warning: useless associativity for '!', use %precedence [-Wprecedence] -input.y:47.12-16: warning: useless associativity for UNARY, use %precedence [-Wprecedence] -input.y:50.7-9: warning: useless associativity for '$', use %precedence [-Wprecedence] -input.y:51.7-9: warning: useless associativity for '(', use %precedence [-Wprecedence] -input.y:51.11-13: warning: useless precedence and associativity for ')' [-Wprecedence] +input.y:39.1-5: warning: useless associativity for FUNC_CALL, use %precedence [-Wprecedence] +input.y:44.1-5: warning: useless associativity for YNUMBER, use %precedence [-Wprecedence] +input.y:44.1-5: warning: useless associativity for YSTRING, use %precedence [-Wprecedence] +input.y:42.1-9: warning: useless precedence and associativity for APPEND_OP [-Wprecedence] +input.y:33.1-6: warning: useless associativity for ASSIGNOP, use %precedence [-Wprecedence] +input.y:43.1-5: warning: useless associativity for CONCAT_OP, use %precedence [-Wprecedence] +input.y:37.1-5: warning: useless precedence and associativity for LEX_GETLINE [-Wprecedence] +input.y:38.1-9: warning: useless associativity for LEX_IN, use %precedence [-Wprecedence] +input.y:49.1-5: warning: useless associativity for INCREMENT, use %precedence [-Wprecedence] +input.y:49.1-5: warning: useless associativity for DECREMENT, use %precedence [-Wprecedence] +input.y:39.1-5: warning: useless associativity for LEX_BUILTIN, use %precedence [-Wprecedence] +input.y:39.1-5: warning: useless associativity for LEX_LENGTH, use %precedence [-Wprecedence] +input.y:40.1-9: warning: useless precedence and associativity for ',' [-Wprecedence] +input.y:47.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] +input.y:47.1-6: warning: useless associativity for UNARY, use %precedence [-Wprecedence] +input.y:50.1-5: warning: useless associativity for '$', use %precedence [-Wprecedence] +input.y:51.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] +input.y:51.1-5: warning: useless precedence and associativity for ')' [-Wprecedence] ]], dnl LAST-STATE @@ -1422,12 +1422,12 @@ input.y:591.14: warning: empty rule without %empty [-Wempty-rule] input.y: warning: 144 reduce/reduce conflicts [-Wconflicts-rr]]], [[input.y: warning: 78 shift/reduce conflicts [-Wconflicts-sr] input.y: warning: 10 reduce/reduce conflicts [-Wconflicts-rr]]])[ -input.y:32.9-12: warning: useless associativity for HQUA, use %precedence [-Wprecedence] -input.y:53.8-14: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence] -input.y:54.9-15: warning: useless associativity for HORELSE, use %precedence [-Wprecedence] -input.y:55.9-16: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence] -input.y:61.9-12: warning: useless associativity for HNOT, use %precedence [-Wprecedence] -input.y:68.7-11: warning: useless associativity for UNEAR, use %precedence [-Wprecedence] +input.y:72.1-5: warning: useless associativity for HQUA, use %precedence [-Wprecedence] +input.y:53.1-6: warning: useless associativity for HASSIGN, use %precedence [-Wprecedence] +input.y:54.1-5: warning: useless associativity for HORELSE, use %precedence [-Wprecedence] +input.y:55.1-5: warning: useless associativity for HANDTHEN, use %precedence [-Wprecedence] +input.y:61.1-5: warning: useless associativity for HNOT, use %precedence [-Wprecedence] +input.y:68.1-5: warning: useless associativity for UNEAR, use %precedence [-Wprecedence] ]], dnl LAST-STATE @@ -2015,87 +2015,87 @@ input.y:292.12: warning: empty rule without %empty [-Wempty-rule] input.y:309.17: warning: empty rule without %empty [-Wempty-rule] input.y:382.13: warning: empty rule without %empty [-Wempty-rule] input.y:471.11-48: warning: rule useless in parser due to conflicts [-Wother] -input.y:19.8-12: warning: useless associativity for LABEL, use %precedence [-Wprecedence] -input.y:20.8-15: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence] -input.y:21.8-13: warning: useless associativity for NUMBER, use %precedence [-Wprecedence] -input.y:22.8-11: warning: useless associativity for TEXT, use %precedence [-Wprecedence] -input.y:25.8-14: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence] -input.y:30.8-11: warning: useless associativity for LAST, use %precedence [-Wprecedence] -input.y:31.8-9: warning: useless associativity for UP, use %precedence [-Wprecedence] -input.y:32.8-11: warning: useless associativity for DOWN, use %precedence [-Wprecedence] -input.y:35.8-10: warning: useless associativity for BOX, use %precedence [-Wprecedence] -input.y:36.8-13: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence] -input.y:37.8-14: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence] -input.y:38.8-10: warning: useless associativity for ARC, use %precedence [-Wprecedence] -input.y:39.8-11: warning: useless associativity for LINE, use %precedence [-Wprecedence] -input.y:40.8-12: warning: useless associativity for ARROW, use %precedence [-Wprecedence] -input.y:42.8-13: warning: useless associativity for SPLINE, use %precedence [-Wprecedence] -input.y:43.8-13: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence] -input.y:44.8-13: warning: useless associativity for RADIUS, use %precedence [-Wprecedence] -input.y:45.8-12: warning: useless associativity for WIDTH, use %precedence [-Wprecedence] -input.y:46.8-15: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence] -input.y:47.8-11: warning: useless associativity for FROM, use %precedence [-Wprecedence] -input.y:48.8-9: warning: useless associativity for TO, use %precedence [-Wprecedence] -input.y:49.8-9: warning: useless associativity for AT, use %precedence [-Wprecedence] -input.y:53.8-12: warning: useless precedence and associativity for SOLID [-Wprecedence] -input.y:54.8-13: warning: useless associativity for DOTTED, use %precedence [-Wprecedence] -input.y:55.8-13: warning: useless associativity for DASHED, use %precedence [-Wprecedence] -input.y:56.8-11: warning: useless associativity for CHOP, use %precedence [-Wprecedence] -input.y:59.8-12: warning: useless precedence and associativity for LJUST [-Wprecedence] -input.y:60.8-12: warning: useless precedence and associativity for RJUST [-Wprecedence] -input.y:61.8-12: warning: useless precedence and associativity for ABOVE [-Wprecedence] -input.y:62.8-12: warning: useless precedence and associativity for BELOW [-Wprecedence] -input.y:63.8-9: warning: useless associativity for OF, use %precedence [-Wprecedence] -input.y:66.8-14: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence] -input.y:67.8-10: warning: useless associativity for AND, use %precedence [-Wprecedence] -input.y:68.8-11: warning: useless associativity for HERE, use %precedence [-Wprecedence] -input.y:69.8-12: warning: useless associativity for DOT_N, use %precedence [-Wprecedence] -input.y:70.8-12: warning: useless associativity for DOT_E, use %precedence [-Wprecedence] -input.y:71.8-12: warning: useless associativity for DOT_W, use %precedence [-Wprecedence] -input.y:72.8-12: warning: useless associativity for DOT_S, use %precedence [-Wprecedence] -input.y:73.8-13: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence] -input.y:74.8-13: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence] -input.y:75.8-13: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence] -input.y:76.8-13: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence] -input.y:77.8-12: warning: useless associativity for DOT_C, use %precedence [-Wprecedence] -input.y:78.8-16: warning: useless associativity for DOT_START, use %precedence [-Wprecedence] -input.y:79.8-14: warning: useless associativity for DOT_END, use %precedence [-Wprecedence] -input.y:85.8-10: warning: useless associativity for SIN, use %precedence [-Wprecedence] -input.y:86.8-10: warning: useless associativity for COS, use %precedence [-Wprecedence] -input.y:87.8-12: warning: useless associativity for ATAN2, use %precedence [-Wprecedence] -input.y:88.8-10: warning: useless associativity for LOG, use %precedence [-Wprecedence] -input.y:89.8-10: warning: useless associativity for EXP, use %precedence [-Wprecedence] -input.y:90.8-11: warning: useless associativity for SQRT, use %precedence [-Wprecedence] -input.y:91.8-12: warning: useless associativity for K_MAX, use %precedence [-Wprecedence] -input.y:92.8-12: warning: useless associativity for K_MIN, use %precedence [-Wprecedence] -input.y:93.8-10: warning: useless associativity for INT, use %precedence [-Wprecedence] -input.y:94.8-11: warning: useless associativity for RAND, use %precedence [-Wprecedence] -input.y:95.8-12: warning: useless associativity for SRAND, use %precedence [-Wprecedence] -input.y:98.8-10: warning: useless associativity for TOP, use %precedence [-Wprecedence] -input.y:99.8-13: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence] -input.y:100.8-12: warning: useless associativity for UPPER, use %precedence [-Wprecedence] -input.y:101.8-12: warning: useless associativity for LOWER, use %precedence [-Wprecedence] -input.y:116.8-18: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence] -input.y:117.8-19: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence] -input.y:118.8-12: warning: useless associativity for NORTH, use %precedence [-Wprecedence] -input.y:119.8-12: warning: useless associativity for SOUTH, use %precedence [-Wprecedence] -input.y:120.8-11: warning: useless associativity for EAST, use %precedence [-Wprecedence] -input.y:121.8-11: warning: useless associativity for WEST, use %precedence [-Wprecedence] -input.y:122.8-13: warning: useless associativity for CENTER, use %precedence [-Wprecedence] -input.y:123.8-10: warning: useless associativity for END, use %precedence [-Wprecedence] -input.y:124.8-12: warning: useless associativity for START, use %precedence [-Wprecedence] -input.y:127.8-11: warning: useless associativity for PLOT, use %precedence [-Wprecedence] -input.y:128.8-16: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence] -input.y:129.8-11: warning: useless associativity for FILL, use %precedence [-Wprecedence] -input.y:130.8-14: warning: useless precedence and associativity for COLORED [-Wprecedence] -input.y:131.8-15: warning: useless precedence and associativity for OUTLINED [-Wprecedence] -input.y:134.8-14: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence] -input.y:137.7-9: warning: useless associativity for '.', use %precedence [-Wprecedence] -input.y:156.23-25: warning: useless associativity for '(', use %precedence [-Wprecedence] -input.y:157.20-22: warning: useless associativity for '`', use %precedence [-Wprecedence] -input.y:159.48-50: warning: useless associativity for '@<:@', use %precedence [-Wprecedence] -input.y:170.7-9: warning: useless associativity for ',', use %precedence [-Wprecedence] -input.y:181.8-10: warning: useless associativity for '!', use %precedence [-Wprecedence] +input.y:154.1-5: warning: useless associativity for LABEL, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for VARIABLE, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for NUMBER, use %precedence [-Wprecedence] +input.y:141.1-5: warning: useless associativity for TEXT, use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for ORDINAL, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for LAST, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for UP, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DOWN, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for BOX, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for CIRCLE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ELLIPSE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ARC, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for LINE, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for ARROW, use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for SPLINE, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for HEIGHT, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for RADIUS, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for WIDTH, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for DIAMETER, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for FROM, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for TO, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for AT, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for SOLID [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DOTTED, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for DASHED, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for CHOP, use %precedence [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for LJUST [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for RJUST [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for ABOVE [-Wprecedence] +input.y:147.1-5: warning: useless precedence and associativity for BELOW [-Wprecedence] +input.y:176.1-5: warning: useless associativity for OF, use %precedence [-Wprecedence] +input.y:176.1-5: warning: useless associativity for BETWEEN, use %precedence [-Wprecedence] +input.y:177.1-5: warning: useless associativity for AND, use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for HERE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_N, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_E, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_W, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_S, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_NE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_SE, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_NW, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_SW, use %precedence [-Wprecedence] +input.y:166.1-5: warning: useless associativity for DOT_C, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for DOT_START, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for DOT_END, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SIN, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for COS, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for ATAN2, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for LOG, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for EXP, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SQRT, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for K_MAX, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for K_MIN, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for INT, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for RAND, use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for SRAND, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for TOP, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for BOTTOM, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for UPPER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for LOWER, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for LEFT_CORNER, use %precedence [-Wprecedence] +input.y:167.1-5: warning: useless associativity for RIGHT_CORNER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for NORTH, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for SOUTH, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for EAST, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for WEST, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for CENTER, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for END, use %precedence [-Wprecedence] +input.y:168.1-5: warning: useless associativity for START, use %precedence [-Wprecedence] +input.y:140.1-5: warning: useless associativity for PLOT, use %precedence [-Wprecedence] +input.y:162.1-5: warning: useless associativity for THICKNESS, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless associativity for FILL, use %precedence [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for COLORED [-Wprecedence] +input.y:153.1-5: warning: useless precedence and associativity for OUTLINED [-Wprecedence] +input.y:141.1-5: warning: useless associativity for SPRINTF, use %precedence [-Wprecedence] +input.y:137.1-5: warning: useless associativity for '.', use %precedence [-Wprecedence] +input.y:156.1-5: warning: useless associativity for '(', use %precedence [-Wprecedence] +input.y:157.1-5: warning: useless associativity for '`', use %precedence [-Wprecedence] +input.y:159.1-5: warning: useless associativity for '@<:@', use %precedence [-Wprecedence] +input.y:170.1-5: warning: useless associativity for ',', use %precedence [-Wprecedence] +input.y:181.1-6: warning: useless associativity for '!', use %precedence [-Wprecedence] ]], dnl LAST-STATE diff --git a/tests/regression.at b/tests/regression.at index f101f218..b9ca94c0 100644 --- a/tests/regression.at +++ b/tests/regression.at @@ -378,8 +378,8 @@ exp: %empty; ]]) AT_BISON_CHECK([-v -Wall -o input.c input.y], 0, [], -[[input.y:1.29-32: warning: useless precedence and associativity for "||" [-Wprecedence] -input.y:2.29-32: warning: useless precedence and associativity for "<=" [-Wprecedence] +[[input.y:3.1-5: warning: useless precedence and associativity for "||" [-Wprecedence] +input.y:3.1-5: warning: useless precedence and associativity for "<=" [-Wprecedence] ]]) AT_CLEANUP @@ -1145,15 +1145,15 @@ sr_conflict: ]AT_YYLEX_DEFINE([{ 1, 2, 3, 0 }])[ ]AT_MAIN_DEFINE[ ]]) -AT_BISON_OPTION_POPDEFS AT_BISON_CHECK([[-Wall -o input.c input.y]], [[0]],, [[input.y:24.5-19: warning: rule useless in parser due to conflicts [-Wother] input.y:28.5-19: warning: rule useless in parser due to conflicts [-Wother] -input.y:18.7-9: warning: useless precedence and associativity for TK1 [-Wprecedence] +input.y:18.1-5: warning: useless precedence and associativity for TK1 [-Wprecedence] ]]) AT_COMPILE([[input]]) AT_PARSER_CHECK([[./input]]) +AT_BISON_OPTION_POPDEFS AT_CLEANUP -- 2.45.2