aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/primary.c
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2008-06-20 06:03:16 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2008-06-20 06:03:16 +0000
commitece3f6639db4f74c38080858ff7629695635c284 (patch)
treee527f2cb222809ccd66862b763928d39fe46824c /gcc/fortran/primary.c
parent2d31e498bf5baf0ad8f3cc1dcea8a1f8a042b2cb (diff)
downloadgcc-ece3f6639db4f74c38080858ff7629695635c284.zip
gcc-ece3f6639db4f74c38080858ff7629695635c284.tar.gz
gcc-ece3f6639db4f74c38080858ff7629695635c284.tar.bz2
arith.c (hollerith2representation): Fix for -Wc++-compat.
* arith.c (hollerith2representation): Fix for -Wc++-compat. * array.c (gfc_get_constructor): Likewise. * decl.c (gfc_get_data_variable, gfc_get_data_value, gfc_get_data, create_enum_history, gfc_match_final_decl): Likewise. * error.c (error_char): Likewise. * expr.c (gfc_get_expr, gfc_copy_expr): Likewise. * gfortran.h (gfc_get_charlen, gfc_get_array_spec, gfc_get_component, gfc_get_formal_arglist, gfc_get_actual_arglist, gfc_get_namelist, gfc_get_omp_clauses, gfc_get_interface, gfc_get_common_head, gfc_get_dt_list, gfc_get_array_ref, gfc_get_ref, gfc_get_equiv, gfc_get_case, gfc_get_iterator, gfc_get_alloc, gfc_get_wide_string): Likewise. * interface.c (count_types_test): Likewise. * intrinsic.c (add_char_conversions, gfc_intrinsic_init_1): Likewise. * io.c (gfc_match_open, gfc_match_close, match_filepos, match_io, gfc_match_inquire, gfc_match_wait): Likewise. * match.c (gfc_match, match_forall_iterator): Likewise. * module.c (gfc_get_pointer_info, gfc_get_use_rename, add_fixup, add_true_name, parse_string, write_atom, quote_string, mio_symtree_ref, mio_gmp_real, write_common_0): Likewise. * options.c (gfc_post_options): Likewise. * primary.c (match_integer_constant, match_hollerith_constant, match_boz_constant, match_real_constant, gfc_get_structure_ctor_component, gfc_match_structure_constructor): Likewise. * scanner.c (gfc_widechar_to_char, add_path_to_list, add_file_change, load_line, get_file, preprocessor_line, load_file, unescape_filename, gfc_read_orig_filename): Likewise. * simplify.c (gfc_simplify_ibits, gfc_simplify_ishft, gfc_simplify_ishftc): Likewise. * symbol.c (gfc_get_st_label, gfc_get_namespace, gfc_new_symtree, gfc_get_uop, gfc_new_symbol, save_symbol_data, gfc_get_gsymbol): Likewise. * target-memory.c (gfc_target_interpret_expr): Likewise. * trans-const.c (gfc_build_wide_string_const): Likewise. * trans-expr.c (gfc_add_interface_mapping): Likewise. * trans-intrinsic.c (gfc_conv_intrinsic_conversion, gfc_conv_intrinsic_int, gfc_conv_intrinsic_lib_function, gfc_conv_intrinsic_cmplx, gfc_conv_intrinsic_ctime, gfc_conv_intrinsic_fdate, gfc_conv_intrinsic_ttynam, gfc_conv_intrinsic_minmax, gfc_conv_intrinsic_minmax_char, gfc_conv_intrinsic_ishftc, gfc_conv_intrinsic_index_scan_verify, gfc_conv_intrinsic_merge, gfc_conv_intrinsic_trim): Likewise. * trans.c (gfc_get_backend_locus): Likewise. * trans.h (gfc_get_ss): Likewise. From-SVN: r136982
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r--gcc/fortran/primary.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index a9b47d8..d7236e1 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -196,7 +196,7 @@ match_integer_constant (gfc_expr **result, int signflag)
if (length == -1)
return MATCH_NO;
- buffer = alloca (length + 1);
+ buffer = (char *) alloca (length + 1);
memset (buffer, '\0', length + 1);
gfc_gobble_whitespace ();
@@ -276,7 +276,7 @@ match_hollerith_constant (gfc_expr **result)
e = gfc_constant_result (BT_HOLLERITH, gfc_default_character_kind,
&gfc_current_locus);
- e->representation.string = gfc_getmem (num + 1);
+ e->representation.string = XCNEWVEC (char, num + 1);
for (i = 0; i < num; i++)
{
@@ -411,7 +411,7 @@ match_boz_constant (gfc_expr **result)
gfc_current_locus = old_loc;
- buffer = alloca (length + 1);
+ buffer = (char *) alloca (length + 1);
memset (buffer, '\0', length + 1);
match_digits (0, radix, buffer);
@@ -562,7 +562,7 @@ done:
gfc_current_locus = old_loc;
gfc_gobble_whitespace ();
- buffer = alloca (count + 1);
+ buffer = (char *) alloca (count + 1);
memset (buffer, '\0', count + 1);
p = buffer;
@@ -1975,8 +1975,7 @@ typedef struct gfc_structure_ctor_component
}
gfc_structure_ctor_component;
-#define gfc_get_structure_ctor_component() \
- gfc_getmem(sizeof(gfc_structure_ctor_component))
+#define gfc_get_structure_ctor_component() XCNEW (gfc_structure_ctor_component)
static void
gfc_free_structure_ctor_component (gfc_structure_ctor_component *comp)
@@ -2023,7 +2022,7 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result)
comp_tail->next = gfc_get_structure_ctor_component ();
comp_tail = comp_tail->next;
}
- comp_tail->name = gfc_getmem(GFC_MAX_SYMBOL_LEN + 1);
+ comp_tail->name = XCNEWVEC (char, GFC_MAX_SYMBOL_LEN + 1);
comp_tail->val = NULL;
comp_tail->where = gfc_current_locus;