mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 15:23:02 +00:00
diagnostics: handle -fno-caret in the called functions
Don't force callers of location_caret to have to deal with flags that disable it. * src/location.h, src/location.c (location_caret) (location_caret_suggestion): Early return if disabled. * src/complain.c: Simplify.
This commit is contained in:
@@ -464,7 +464,7 @@ error_message (const location *loc, int *indent, warnings flags,
|
||||
{
|
||||
putc ('\n', stderr);
|
||||
flush (stderr);
|
||||
if (loc && feature_flag & feature_caret && !(flags & no_caret))
|
||||
if (loc && !(flags & no_caret))
|
||||
location_caret (*loc, style, stderr);
|
||||
}
|
||||
}
|
||||
@@ -555,8 +555,7 @@ deprecated_directive (location const *loc, char const *old, char const *upd)
|
||||
complain (loc, Wdeprecated,
|
||||
_("deprecated directive: %s, use %s"),
|
||||
quote (old), quote_n (1, upd));
|
||||
if (feature_flag & feature_caret)
|
||||
location_caret_suggestion (*loc, upd, stderr);
|
||||
location_caret_suggestion (*loc, upd, stderr);
|
||||
/* Register updates only if -Wdeprecated is enabled. */
|
||||
fixits_register (loc, upd);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user