Mark strings for translation by enclosing in G_() and _().
2020-06-24 Mark Eggleston <markeggleston@gcc.gnu.org>
gcc/fortran/
PR fortran/52279
* arith.c (reduce_binary_aa): Mark for translation the string
parameter to gfc_check_conformance with G_().
* check.c (gfc_invalid_boz): Mark hint for translation using
_(). (gfc_check_achar): Mark for translation the message
parameter to gfc_invalid_boz using G_(). (gfc_check_char):
Mark for translation the message parameter to gfc_invalid_boz
using G_(). (gfc_check_complex): Mark for translation the
message parameter to gfc_invalid_boz using G_().
(gfc_check_float): Mark for translation the message
parameter to gfc_invalid_boz using G_(). (check_rest): Mark
for translation the string parameter to gfc_check_conformance
with _(). (gfc_check_minloc_maxloc): Mark for translation
the string parameter to gfc_check_conformance with _().
(gfc_check_findloc): Mark for translation the string parameter
to gfc_check_conformance with _(). (check_reduction): Mark
for translation the string parameter to gfc_check_conformance
with _(). (gfc_check_pack): Mark for translation the string
parameter to gfc_check_conformance with _().
* decl.c (match_old_style_init): Mark for translation the
message parameter to gfc_invalid_boz using G_().
* expr.c (gfc_check_assign): Mark for translation the string
parameter to gfc_check_conformance with _().
* intrinsic.c (check_specific): Mark for translation the string
parameter to gfc_check_conformance with _().
(gfc_check_intrinsic_standard): Mark symstd_msg strings for
translation using G_(). No need to mark symstd_msg for
translation in call to gfc_warning or when setting symstd.
* io.c (check_open_constraints): Mark strings for translation
using G_() in all calls to warn_or_error. (match_io_element):
Mark for translation the message parameter to gfc_invalid_boz
using G_().
* primary.c (match_boz_constant): Mark for translation the
message parameter to gfc_invalid_boz using G_().
* resolve.c (resolve_elemental_actual): Mark for translation
the string parameter to gfc_check_conformance with _().
(resolve_operator): Mark for translation the string parameter
to gfc_check_conformance with _(). Mark translation strings
assigned to msg using G_() for use in a call to cfg_warning.
gfc_expr *r;
arith rc = ARITH_OK;
- if (!gfc_check_conformance (op1, op2, "elemental binary operation"))
+ if (!gfc_check_conformance (op1, op2, _("elemental binary operation")))
return ARITH_INCOMMENSURATE;
head = gfc_constructor_copy (op1->value.constructor);
return false;
}
- const char hint[] = " [see %<-fno-allow-invalid-boz%>]";
+ const char hint[] = _(" [see %<-fno-allow-invalid-boz%>]");
size_t len = strlen (msg) + strlen (hint) + 1;
char *msg2 = (char *) alloca (len);
strcpy (msg2, msg);
{
if (a->ts.type == BT_BOZ)
{
- if (gfc_invalid_boz ("BOZ literal constant at %L cannot appear in "
- "ACHAR intrinsic subprogram", &a->where))
+ if (gfc_invalid_boz (G_("BOZ literal constant at %L cannot appear in "
+ "ACHAR intrinsic subprogram"), &a->where))
return false;
if (!gfc_boz2int (a, gfc_default_integer_kind))
{
if (i->ts.type == BT_BOZ)
{
- if (gfc_invalid_boz ("BOZ literal constant at %L cannot appear in "
- "CHAR intrinsic subprogram", &i->where))
+ if (gfc_invalid_boz (G_("BOZ literal constant at %L cannot appear in "
+ "CHAR intrinsic subprogram"), &i->where))
return false;
if (!gfc_boz2int (i, gfc_default_integer_kind))
if (x->ts.type == BT_BOZ)
{
- if (gfc_invalid_boz ("BOZ constant at %L cannot appear in the COMPLEX "
- "intrinsic subprogram", &x->where))
+ if (gfc_invalid_boz (G_("BOZ constant at %L cannot appear in the COMPLEX"
+ " intrinsic subprogram"), &x->where))
{
reset_boz (x);
return false;
if (y->ts.type == BT_BOZ)
{
- if (gfc_invalid_boz ("BOZ constant at %L cannot appear in the COMPLEX "
- "intrinsic subprogram", &y->where))
+ if (gfc_invalid_boz (G_("BOZ constant at %L cannot appear in the COMPLEX"
+ " intrinsic subprogram"), &y->where))
{
reset_boz (y);
return false;
{
if (a->ts.type == BT_BOZ)
{
- if (gfc_invalid_boz ("BOZ literal constant at %L cannot appear in the "
- "FLOAT intrinsic subprogram", &a->where))
+ if (gfc_invalid_boz (G_("BOZ literal constant at %L cannot appear in the"
+ " FLOAT intrinsic subprogram"), &a->where))
{
reset_boz (a);
return false;
for (tmp = arglist, m=1; tmp != arg; tmp = tmp->next, m++)
if (!gfc_check_conformance (tmp->expr, x,
- "arguments 'a%d' and 'a%d' for "
- "intrinsic '%s'", m, n,
+ _("arguments 'a%d' and 'a%d' for "
+ "intrinsic '%s'"), m, n,
gfc_current_intrinsic))
return false;
}
if (m != NULL
&& !gfc_check_conformance (a, m,
- "arguments '%s' and '%s' for intrinsic %s",
+ _("arguments '%s' and '%s' for intrinsic %s"),
gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic_arg[2]->name,
gfc_current_intrinsic))
if (m != NULL
&& !gfc_check_conformance (a, m,
- "arguments '%s' and '%s' for intrinsic %s",
+ _("arguments '%s' and '%s' for intrinsic %s"),
gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic_arg[3]->name,
gfc_current_intrinsic))
if (m != NULL
&& !gfc_check_conformance (a, m,
- "arguments '%s' and '%s' for intrinsic %s",
+ _("arguments '%s' and '%s' for intrinsic %s"),
gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic_arg[2]->name,
gfc_current_intrinsic))
return false;
if (!gfc_check_conformance (array, mask,
- "arguments '%s' and '%s' for intrinsic '%s'",
+ _("arguments '%s' and '%s' for intrinsic '%s'"),
gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic_arg[1]->name,
gfc_current_intrinsic))
for (nd = newdata; nd; nd = nd->next)
{
if (nd->value->expr->ts.type == BT_BOZ
- && gfc_invalid_boz ("BOZ at %L cannot appear in an old-style "
- "initialization", &nd->value->expr->where))
+ && gfc_invalid_boz (G_("BOZ at %L cannot appear in an old-style "
+ "initialization"), &nd->value->expr->where))
return MATCH_ERROR;
if (nd->var->expr->ts.type != BT_INTEGER
&& nd->var->expr->ts.type != BT_REAL
&& nd->value->expr->ts.type == BT_BOZ)
{
- gfc_error ("BOZ literal constant near %L cannot be assigned to "
- "a %qs variable in an old-style initialization",
+ gfc_error (G_("BOZ literal constant near %L cannot be assigned to "
+ "a %qs variable in an old-style initialization"),
&nd->value->expr->where,
gfc_typename (&nd->value->expr->ts));
return MATCH_ERROR;
/* Check size of array assignments. */
if (lvalue->rank != 0 && rvalue->rank != 0
- && !gfc_check_conformance (lvalue, rvalue, "array assignment"))
+ && !gfc_check_conformance (lvalue, rvalue, _("array assignment")))
return false;
/* Handle the case of a BOZ literal on the RHS. */
for ( ; arg && arg->expr; arg = arg->next, n++)
if (!gfc_check_conformance (first_expr, arg->expr,
- "arguments '%s' and '%s' for "
- "intrinsic '%s'",
+ _("arguments '%s' and '%s' for "
+ "intrinsic '%s'"),
gfc_current_intrinsic_arg[0]->name,
gfc_current_intrinsic_arg[n]->name,
gfc_current_intrinsic))
switch (isym->standard)
{
case GFC_STD_F77:
- symstd_msg = "available since Fortran 77";
+ symstd_msg = _("available since Fortran 77");
break;
case GFC_STD_F95_OBS:
- symstd_msg = "obsolescent in Fortran 95";
+ symstd_msg = _("obsolescent in Fortran 95");
break;
case GFC_STD_F95_DEL:
- symstd_msg = "deleted in Fortran 95";
+ symstd_msg = _("deleted in Fortran 95");
break;
case GFC_STD_F95:
- symstd_msg = "new in Fortran 95";
+ symstd_msg = _("new in Fortran 95");
break;
case GFC_STD_F2003:
- symstd_msg = "new in Fortran 2003";
+ symstd_msg = _("new in Fortran 2003");
break;
case GFC_STD_F2008:
- symstd_msg = "new in Fortran 2008";
+ symstd_msg = _("new in Fortran 2008");
break;
case GFC_STD_F2018:
- symstd_msg = "new in Fortran 2018";
+ symstd_msg = _("new in Fortran 2018");
break;
case GFC_STD_GNU:
- symstd_msg = "a GNU Fortran extension";
+ symstd_msg = _("a GNU Fortran extension");
break;
case GFC_STD_LEGACY:
- symstd_msg = "for backward compatibility";
+ symstd_msg = _("for backward compatibility");
break;
default:
{
/* Do only print a warning if not a GNU extension. */
if (!silent && isym->standard != GFC_STD_GNU)
- gfc_warning (0, "Intrinsic %qs (is %s) is used at %L",
- isym->name, _(symstd_msg), &where);
+ gfc_warning (0, "Intrinsic %qs (%s) used at %L",
+ isym->name, symstd_msg, &where);
return true;
}
/* Otherwise, fail. */
if (symstd)
- *symstd = _(symstd_msg);
+ *symstd = symstd_msg;
return false;
}
&& open->recl->ts.type == BT_INTEGER
&& mpz_sgn (open->recl->value.integer) != 1)
{
- warn_or_error ("RECL in OPEN statement at %L must be positive",
+ warn_or_error (G_("RECL in OPEN statement at %L must be positive"),
&open->recl->where);
}
{
char *s = gfc_widechar_to_char (open->status->value.character.string,
-1);
- warn_or_error ("The STATUS specified in OPEN statement at %L is "
- "%qs and no FILE specifier is present",
+ warn_or_error (G_("The STATUS specified in OPEN statement at %L is "
+ "%qs and no FILE specifier is present"),
&open->status->where, s);
free (s);
}
if (gfc_wide_strncasecmp (open->status->value.character.string,
"scratch", 7) == 0 && open->file)
{
- warn_or_error ("The STATUS specified in OPEN statement at %L "
+ warn_or_error (G_("The STATUS specified in OPEN statement at %L "
"cannot have the value SCRATCH if a FILE specifier "
- "is present", &open->status->where);
+ "is present"), &open->status->where);
}
}
spec = "";
}
- warn_or_error ("%s specifier at %L not allowed in OPEN statement for "
- "unformatted I/O", spec, loc);
+ warn_or_error (G_("%s specifier at %L not allowed in OPEN statement for "
+ "unformatted I/O"), spec, loc);
}
if (open->recl && open->access && open->access->expr_type == EXPR_CONSTANT
&& gfc_wide_strncasecmp (open->access->value.character.string,
"stream", 6) == 0)
{
- warn_or_error ("RECL specifier not allowed in OPEN statement at %L for "
- "stream I/O", &open->recl->where);
+ warn_or_error (G_("RECL specifier not allowed in OPEN statement at %L for "
+ "stream I/O"), &open->recl->where);
}
if (open->position
|| gfc_wide_strncasecmp (open->access->value.character.string,
"append", 6) == 0))
{
- warn_or_error ("POSITION specifier in OPEN statement at %L only allowed "
- "for stream or sequential ACCESS", &open->position->where);
+ warn_or_error (G_("POSITION specifier in OPEN statement at %L only allowed "
+ "for stream or sequential ACCESS"), &open->position->where);
}
return true;
if (m == MATCH_YES && expr->ts.type == BT_BOZ)
{
- if (gfc_invalid_boz ("BOZ literal constant at %L cannot appear in "
- "an output IO list", &gfc_current_locus))
+ if (gfc_invalid_boz (G_("BOZ literal constant at %L cannot appear in"
+ " an output IO list"), &gfc_current_locus))
return MATCH_ERROR;
if (!gfc_boz2int (expr, gfc_max_integer_kind))
return MATCH_ERROR;
goto backup;
if (x_hex
- && gfc_invalid_boz ("Hexadecimal constant at %L uses "
- "nonstandard X instead of Z", &gfc_current_locus))
+ && gfc_invalid_boz (G_("Hexadecimal constant at %L uses "
+ "nonstandard X instead of Z"), &gfc_current_locus))
return MATCH_ERROR;
old_loc = gfc_current_locus;
goto backup;
}
- if (gfc_invalid_boz ("BOZ constant at %C uses nonstandard postfix "
- "syntax", &gfc_current_locus))
+ if (gfc_invalid_boz (G_("BOZ constant at %C uses nonstandard postfix "
+ "syntax"), &gfc_current_locus))
return MATCH_ERROR;
}
/* Elemental procedure's array actual arguments must conform. */
if (e != NULL)
{
- if (!gfc_check_conformance (arg->expr, e, "elemental procedure"))
+ if (!gfc_check_conformance (arg->expr, e, _("elemental procedure")))
return false;
}
else
/* If op1 is BOZ, then op2 is not!. Try to convert to type of op2. */
if (op1->ts.type == BT_BOZ)
{
- if (gfc_invalid_boz ("BOZ literal constant near %L cannot appear as "
- "an operand of a relational operator",
- &op1->where))
+ if (gfc_invalid_boz (G_("BOZ literal constant near %L cannot appear "
+ "as an operand of a relational operator"),
+ &op1->where))
return false;
if (op2->ts.type == BT_INTEGER && !gfc_boz2int (op1, op2->ts.kind))
/* If op2 is BOZ, then op1 is not!. Try to convert to type of op2. */
if (op2->ts.type == BT_BOZ)
{
- if (gfc_invalid_boz ("BOZ literal constant near %L cannot appear as "
- "an operand of a relational operator",
+ if (gfc_invalid_boz (G_("BOZ literal constant near %L cannot appear"
+ " as an operand of a relational operator"),
&op2->where))
return false;
const char *msg;
if (op == INTRINSIC_EQ || op == INTRINSIC_EQ_OS)
- msg = "Equality comparison for %s at %L";
+ msg = G_("Equality comparison for %s at %L");
else
- msg = "Inequality comparison for %s at %L";
+ msg = G_("Inequality comparison for %s at %L");
gfc_warning (OPT_Wcompare_reals, msg,
gfc_typename (op1), &op1->where);