diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2014-12-31 15:50:10 +0100 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2014-12-31 15:50:10 +0100 |
commit | 1a33dc9ec24fed0406de07f54e0442915e3cfedb (patch) | |
tree | 5b0e17f5acd2cb905b0d28cea526ba21ab59c791 /gcc/fortran/trans-expr.c | |
parent | e8ef82d74f40e216b3a1c9707a79a3bd0b6c953d (diff) | |
download | gcc-1a33dc9ec24fed0406de07f54e0442915e3cfedb.zip gcc-1a33dc9ec24fed0406de07f54e0442915e3cfedb.tar.gz gcc-1a33dc9ec24fed0406de07f54e0442915e3cfedb.tar.bz2 |
trans-array.c (trans_array_bound_check): Use xasprintf instead of unchecked asprintf.
* trans-array.c (trans_array_bound_check): Use xasprintf instead
of unchecked asprintf.
(gfc_conv_array_ref): Ditto.
(gfc_conv_ss_startstride): Ditto.
(gfc_trans_dummy_array_bias): Ditto.
(gfc_conv_array_parameter): Ditto.
* trans-decl.c (gfc_generate_function_code): Ditto.
* trans-expr.c (gfc_conv_substring): Ditto.
(gfc_conv_procedure_call): Ditto.
* trans-io.c (gfc_trans_io_runtime_check): Ditto.
(set_string): Ditto.
* trans.c (trans-runtime_error_vararg): Ditto.
From-SVN: r219126
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r-- | gcc/fortran/trans-expr.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 3793cfb..85c77b7 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -1799,11 +1799,11 @@ gfc_conv_substring (gfc_se * se, gfc_ref * ref, int kind, 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)); @@ -1815,11 +1815,11 @@ gfc_conv_substring (gfc_se * se, gfc_ref * ref, int kind, 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, @@ -4930,18 +4930,19 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, 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; @@ -4963,16 +4964,16 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, { 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; |