tmp_up = gfc_conv_array_ubound (descriptor, n);
if (name)
- asprintf (&msg, "Index '%%ld' of dimension %d of array '%s' "
- "outside of expected range (%%ld:%%ld)", n+1, name);
+ msg = xasprintf ("Index '%%ld' of dimension %d of array '%s' "
+ "outside of expected range (%%ld:%%ld)", n+1, name);
else
- asprintf (&msg, "Index '%%ld' of dimension %d "
- "outside of expected range (%%ld:%%ld)", n+1);
+ msg = xasprintf ("Index '%%ld' of dimension %d "
+ "outside of expected range (%%ld:%%ld)", n+1);
fault = fold_build2_loc (input_location, LT_EXPR, boolean_type_node,
index, tmp_lo);
tmp_lo = gfc_conv_array_lbound (descriptor, n);
if (name)
- asprintf (&msg, "Index '%%ld' of dimension %d of array '%s' "
- "below lower bound of %%ld", n+1, name);
+ msg = xasprintf ("Index '%%ld' of dimension %d of array '%s' "
+ "below lower bound of %%ld", n+1, name);
else
- asprintf (&msg, "Index '%%ld' of dimension %d "
- "below lower bound of %%ld", n+1);
+ msg = xasprintf ("Index '%%ld' of dimension %d "
+ "below lower bound of %%ld", n+1);
fault = fold_build2_loc (input_location, LT_EXPR, boolean_type_node,
index, tmp_lo);
cond = fold_build2_loc (input_location, LT_EXPR, boolean_type_node,
indexse.expr, tmp);
- asprintf (&msg, "Index '%%ld' of dimension %d of array '%s' "
- "below lower bound of %%ld", n+1, var_name);
+ msg = xasprintf ("Index '%%ld' of dimension %d of array '%s' "
+ "below lower bound of %%ld", n+1, var_name);
gfc_trans_runtime_check (true, false, cond, &se->pre, where, msg,
fold_convert (long_integer_type_node,
indexse.expr),
cond = fold_build2_loc (input_location, GT_EXPR,
boolean_type_node, indexse.expr, tmp);
- asprintf (&msg, "Index '%%ld' of dimension %d of array '%s' "
- "above upper bound of %%ld", n+1, var_name);
+ msg = xasprintf ("Index '%%ld' of dimension %d of array '%s' "
+ "above upper bound of %%ld", n+1, var_name);
gfc_trans_runtime_check (true, false, cond, &se->pre, where, msg,
fold_convert (long_integer_type_node,
indexse.expr),
/* Zero stride is not allowed. */
tmp = fold_build2_loc (input_location, EQ_EXPR, boolean_type_node,
info->stride[dim], gfc_index_zero_node);
- asprintf (&msg, "Zero stride is not allowed, for dimension %d "
- "of array '%s'", dim + 1, expr_name);
+ msg = xasprintf ("Zero stride is not allowed, for dimension %d "
+ "of array '%s'", dim + 1, expr_name);
gfc_trans_runtime_check (true, false, tmp, &inner,
expr_loc, msg);
free (msg);
tmp2 = fold_build2_loc (input_location, TRUTH_AND_EXPR,
boolean_type_node,
non_zerosized, tmp2);
- asprintf (&msg, "Index '%%ld' of dimension %d of array '%s' "
- "outside of expected range (%%ld:%%ld)",
- dim + 1, expr_name);
+ msg = xasprintf ("Index '%%ld' of dimension %d of array '%s' "
+ "outside of expected range (%%ld:%%ld)",
+ dim + 1, expr_name);
gfc_trans_runtime_check (true, false, tmp, &inner,
expr_loc, msg,
fold_convert (long_integer_type_node, info->start[dim]),
info->start[dim], lbound);
tmp = fold_build2_loc (input_location, TRUTH_AND_EXPR,
boolean_type_node, non_zerosized, tmp);
- asprintf (&msg, "Index '%%ld' of dimension %d of array '%s' "
- "below lower bound of %%ld",
- dim + 1, expr_name);
+ msg = xasprintf ("Index '%%ld' of dimension %d of array '%s' "
+ "below lower bound of %%ld",
+ dim + 1, expr_name);
gfc_trans_runtime_check (true, false, tmp, &inner,
expr_loc, msg,
fold_convert (long_integer_type_node, info->start[dim]),
boolean_type_node, tmp, ubound);
tmp3 = fold_build2_loc (input_location, TRUTH_AND_EXPR,
boolean_type_node, non_zerosized, tmp3);
- asprintf (&msg, "Index '%%ld' of dimension %d of array '%s' "
- "outside of expected range (%%ld:%%ld)",
- dim + 1, expr_name);
+ msg = xasprintf ("Index '%%ld' of dimension %d of array '%s' "
+ "outside of expected range (%%ld:%%ld)",
+ dim + 1, expr_name);
gfc_trans_runtime_check (true, false, tmp2, &inner,
expr_loc, msg,
fold_convert (long_integer_type_node, tmp),
}
else
{
- asprintf (&msg, "Index '%%ld' of dimension %d of array '%s' "
- "below lower bound of %%ld",
- dim + 1, expr_name);
+ msg = xasprintf ("Index '%%ld' of dimension %d of array '%s' "
+ "below lower bound of %%ld",
+ dim + 1, expr_name);
gfc_trans_runtime_check (true, false, tmp2, &inner,
expr_loc, msg,
fold_convert (long_integer_type_node, tmp),
{
tmp3 = fold_build2_loc (input_location, NE_EXPR,
boolean_type_node, tmp, size[n]);
- asprintf (&msg, "Array bound mismatch for dimension %d "
- "of array '%s' (%%ld/%%ld)",
- dim + 1, expr_name);
+ msg = xasprintf ("Array bound mismatch for dimension %d "
+ "of array '%s' (%%ld/%%ld)",
+ dim + 1, expr_name);
gfc_trans_runtime_check (true, false, tmp3, &inner,
expr_loc, msg,
gfc_index_one_node, stride2);
tmp = fold_build2_loc (input_location, NE_EXPR,
gfc_array_index_type, temp, stride2);
- asprintf (&msg, "Dimension %d of array '%s' has extent "
- "%%ld instead of %%ld", n+1, sym->name);
+ msg = xasprintf ("Dimension %d of array '%s' has extent "
+ "%%ld instead of %%ld", n+1, sym->name);
gfc_trans_runtime_check (true, false, tmp, &init, &loc, msg,
fold_convert (long_integer_type_node, temp),
char * msg;
if (fsym && proc_name)
- asprintf (&msg, "An array temporary was created for argument "
- "'%s' of procedure '%s'", fsym->name, proc_name);
+ msg = xasprintf ("An array temporary was created for argument "
+ "'%s' of procedure '%s'", fsym->name, proc_name);
else
- asprintf (&msg, "An array temporary was created");
+ msg = xasprintf ("An array temporary was created");
tmp = build_fold_indirect_ref_loc (input_location,
desc);
fault = fold_build2_loc (input_location, TRUTH_ANDIF_EXPR,
boolean_type_node, nonempty, fault);
if (name)
- asprintf (&msg, "Substring out of bounds: lower bound (%%ld) of '%s' "
- "is less than one", name);
+ msg = xasprintf ("Substring out of bounds: lower bound (%%ld) of '%s' "
+ "is less than one", name);
else
- asprintf (&msg, "Substring out of bounds: lower bound (%%ld)"
- "is less than one");
+ msg = xasprintf ("Substring out of bounds: lower bound (%%ld)"
+ "is less than one");
gfc_trans_runtime_check (true, false, fault, &se->pre, where, msg,
fold_convert (long_integer_type_node,
start.expr));
fault = fold_build2_loc (input_location, TRUTH_ANDIF_EXPR,
boolean_type_node, nonempty, fault);
if (name)
- asprintf (&msg, "Substring out of bounds: upper bound (%%ld) of '%s' "
- "exceeds string length (%%ld)", name);
+ msg = xasprintf ("Substring out of bounds: upper bound (%%ld) of '%s' "
+ "exceeds string length (%%ld)", name);
else
- asprintf (&msg, "Substring out of bounds: upper bound (%%ld) "
- "exceeds string length (%%ld)");
+ msg = xasprintf ("Substring out of bounds: upper bound (%%ld) "
+ "exceeds string length (%%ld)");
gfc_trans_runtime_check (true, false, fault, &se->pre, where, msg,
fold_convert (long_integer_type_node, end.expr),
fold_convert (long_integer_type_node,
if (attr.allocatable
&& (fsym == NULL || !fsym->attr.allocatable))
- asprintf (&msg, "Allocatable actual argument '%s' is not "
- "allocated or not present", e->symtree->n.sym->name);
+ msg = xasprintf ("Allocatable actual argument '%s' is not "
+ "allocated or not present",
+ e->symtree->n.sym->name);
else if (attr.pointer
&& (fsym == NULL || !fsym->attr.pointer))
- asprintf (&msg, "Pointer actual argument '%s' is not "
- "associated or not present",
- e->symtree->n.sym->name);
+ msg = xasprintf ("Pointer actual argument '%s' is not "
+ "associated or not present",
+ e->symtree->n.sym->name);
else if (attr.proc_pointer
&& (fsym == NULL || !fsym->attr.proc_pointer))
- asprintf (&msg, "Proc-pointer actual argument '%s' is not "
- "associated or not present",
- e->symtree->n.sym->name);
+ msg = xasprintf ("Proc-pointer actual argument '%s' is not "
+ "associated or not present",
+ e->symtree->n.sym->name);
else
goto end_pointer_check;
{
if (attr.allocatable
&& (fsym == NULL || !fsym->attr.allocatable))
- asprintf (&msg, "Allocatable actual argument '%s' is not "
- "allocated", e->symtree->n.sym->name);
+ msg = xasprintf ("Allocatable actual argument '%s' is not "
+ "allocated", e->symtree->n.sym->name);
else if (attr.pointer
&& (fsym == NULL || !fsym->attr.pointer))
- asprintf (&msg, "Pointer actual argument '%s' is not "
- "associated", e->symtree->n.sym->name);
+ msg = xasprintf ("Pointer actual argument '%s' is not "
+ "associated", e->symtree->n.sym->name);
else if (attr.proc_pointer
&& (fsym == NULL || !fsym->attr.proc_pointer))
- asprintf (&msg, "Proc-pointer actual argument '%s' is not "
- "associated", e->symtree->n.sym->name);
+ msg = xasprintf ("Proc-pointer actual argument '%s' is not "
+ "associated", e->symtree->n.sym->name);
else
goto end_pointer_check;