https://gcc.gnu.org/g:58784833e8e3766c3cba0a64527b0e1f1ca3a624
commit r16-7619-g58784833e8e3766c3cba0a64527b0e1f1ca3a624 Author: Jose E. Marchesi <[email protected]> Date: Sat Feb 21 22:33:46 2026 +0100 a68: couple more fixes for error formatting tags Signed-off-by: Jose E. Marchesi <[email protected]> gcc/algol68/ChangeLog * a68-parser-bottom-up.cc (reduce_formal_holes): Fix error format tag. * a68-parser-taxes.cc (test_firmly_related_ops_local): Likewise. (already_declared_hidden): Likewise. Diff: --- gcc/algol68/a68-parser-bottom-up.cc | 2 +- gcc/algol68/a68-parser-taxes.cc | 27 ++++++++++++++++----------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/gcc/algol68/a68-parser-bottom-up.cc b/gcc/algol68/a68-parser-bottom-up.cc index 2c0f9bd35414..f6da861bf345 100644 --- a/gcc/algol68/a68-parser-bottom-up.cc +++ b/gcc/algol68/a68-parser-bottom-up.cc @@ -1875,7 +1875,7 @@ reduce_formal_holes (NODE_T *p) && IS (SUB (SUB (SUB (s))), DENOTATION) && IS (SUB (SUB (SUB (SUB (s)))), ROW_CHAR_DENOTATION))) { - a68_error (s, "expected row char denotation"); + a68_error (s, "expected %<row char%> denotation"); } } } diff --git a/gcc/algol68/a68-parser-taxes.cc b/gcc/algol68/a68-parser-taxes.cc index bfb6a6d02bfa..6227732ebc64 100644 --- a/gcc/algol68/a68-parser-taxes.cc +++ b/gcc/algol68/a68-parser-taxes.cc @@ -589,23 +589,25 @@ test_firmly_related_ops_local (NODE_T *p, TAG_T *s) && warn_algol68_hidden_declarations > 0) { if (a68_warning (p, OPT_Whidden_declarations_, - "Z hides a firmly related operator in a larger reach", + "%qs hides a firmly related operator in a larger reach", NSYMBOL (NODE (s)))) { + a68_moid_format_token m (MOID (t)); a68_inform (NO_NODE, - "operator M Z defined in the standard prelude", - MOID (t), NSYMBOL (NODE (t))); + "operator %e %qs defined in the standard prelude", + &m, NSYMBOL (NODE (t))); } } else if (warn_algol68_hidden_declarations > 1) { if (a68_warning (p, OPT_Whidden_declarations_, - "Z hides a firmly related operator in a larger reach", + "%qs hides a firmly related operator in a larger reach", NSYMBOL (NODE (s)))) { + a68_symbol_format_token s1 (NODE (s)); a68_inform (NODE (t), - "previous hidden declaration of S declared here", - NSYMBOL (NODE (s))); + "previous hidden declaration of %e declared here", + &s1); } } @@ -681,16 +683,19 @@ already_declared_hidden (NODE_T *n, int a) || (TAG_TABLE (s) != A68_STANDENV && warn_algol68_hidden_declarations > 1))) { if (a68_warning (n, OPT_Whidden_declarations_, - "Z hides a declaration with larger reach", + "%qs hides a declaration with larger reach", NSYMBOL (n))) { if (TAG_TABLE (s) == A68_STANDENV) - a68_inform (NO_NODE, - "M Z defined in the standard prelude", - MOID (s), NSYMBOL (NODE (s))); + { + a68_moid_format_token m (MOID (s)); + a68_inform (NO_NODE, + "%e %qs defined in the standard prelude", + &m, NSYMBOL (NODE (s))); + } else a68_inform (NODE (s), - "previous hidden declaration of S declared here", + "previous hidden declaration of %qs declared here", NSYMBOL (n)); } }
