===================================================================
@@ -1052,6 +1052,10 @@ output_stack_usage (void)
if (warn_stack_usage >= 0)
{
+ /* Avoid displaying the caret in a bogus position. */
+ const bool saved_show_caret = global_dc->show_caret;
+ global_dc->show_caret = false;
+
if (stack_usage_kind == DYNAMIC)
warning (OPT_Wstack_usage_, "stack usage might be unbounded");
else if (stack_usage > warn_stack_usage)
@@ -1063,6 +1067,8 @@ output_stack_usage (void)
warning (OPT_Wstack_usage_, "stack usage is %wd bytes",
stack_usage);
}
+
+ global_dc->show_caret = saved_show_caret;
}
}