X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/c932d6135ca3e508f7136810b9b0bf79725290b9..d065cb3853cf5763a035abbb58f6c5f598af7879:/src/gram.c diff --git a/src/gram.c b/src/gram.c index cd9e67cb..69a4857e 100644 --- a/src/gram.c +++ b/src/gram.c @@ -1,6 +1,6 @@ /* Allocate input grammar variables for Bison. - Copyright (C) 1984, 1986, 1989, 2001-2003, 2005-2012 Free Software + Copyright (C) 1984, 1986, 1989, 2001-2003, 2005-2013 Free Software Foundation, Inc. This file is part of Bison, the GNU Compiler Compiler. @@ -21,8 +21,6 @@ #include #include "system.h" -#include - #include "complain.h" #include "getargs.h" #include "gram.h" @@ -310,11 +308,16 @@ grammar_rules_useless_report (const char *message) for (r = 0; r < nrules ; ++r) if (!rules[r].useful) { - warn_at (rules[r].location, "%s: ", message); - if (warnings_flag & warnings_other) + if (feature_flag & feature_caret) + warn_at (rules[r].location, "%s", message); + else { - rule_print (&rules[r], stderr); - fflush (stderr); + warn_at (rules[r].location, "%s: ", message); + if (warnings_flag & warnings_other) + { + rule_print (&rules[r], stderr); + fflush (stderr); + } } } }