2012-01-29 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/51808
* decl.c (set_binding_label): Make binding_label argument const.
(curr_binding_label): Constify.
* gfortran.h (gfc_symbol): Constify binding_label.
(gfc_common_head): Likewise.
(get_iso_c_sym): Likewise.
* match.c (gfc_match_name_C): Constify buffer argument.
* match.h (gfc_match_name_C): Likewise.
* resolve.c (set_name_and_label): Constify binding_label argument.
(gfc_iso_c_sub_interface): Constify binding_label variable.
* symbol.c (get_iso_c_sym): Constify binding_label argument.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183679
138bc75d-0d04-0410-961f-
82ee72b054a4
2012-01-29 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/51808
+ * decl.c (set_binding_label): Make binding_label argument const.
+ (curr_binding_label): Constify.
+ * gfortran.h (gfc_symbol): Constify binding_label.
+ (gfc_common_head): Likewise.
+ (get_iso_c_sym): Likewise.
+ * match.c (gfc_match_name_C): Constify buffer argument.
+ * match.h (gfc_match_name_C): Likewise.
+ * resolve.c (set_name_and_label): Constify binding_label argument.
+ (gfc_iso_c_sub_interface): Constify binding_label variable.
+ * symbol.c (get_iso_c_sym): Constify binding_label argument.
+
+2012-01-29 Janne Blomqvist <jb@gcc.gnu.org>
+
+ PR fortran/51808
* decl.c (set_binding_label): Move prototype from match.h to here.
(curr_binding_label): Make a pointer rather than static array.
(build_sym): Check sym->binding_label pointer rather than array,
#define gfc_get_data() XCNEW (gfc_data)
-static gfc_try set_binding_label (char **, const char *, int);
+static gfc_try set_binding_label (const char **, const char *, int);
/* This flag is set if an old-style length selector is matched
static int colon_seen;
/* The current binding label (if any). */
-static char* curr_binding_label;
+static const char* curr_binding_label;
/* Need to know how many identifiers are on the current data declaration
line in case we're given the BIND(C) attribute with a NAME= specifier. */
static int num_idents_on_line;
there is more than one argument (num_idents), it is an error. */
static gfc_try
-set_binding_label (char **dest_label, const char *sym_name, int num_idents)
+set_binding_label (const char **dest_label, const char *sym_name,
+ int num_idents)
{
if (num_idents > 1 && has_name_equals)
{
gfc_match_bind_c (gfc_symbol *sym, bool allow_binding_name)
{
/* binding label, if exists */
- char* binding_label = NULL;
+ const char* binding_label = NULL;
match double_quote;
match single_quote;
/* This may be repetitive, since the typespec now has a binding
label field. */
- char* binding_label;
+ const char* binding_label;
/* Store a reference to the common_block, if this symbol is in one. */
struct gfc_common_head *common_block;
char use_assoc, saved, threadprivate;
char name[GFC_MAX_SYMBOL_LEN + 1];
struct gfc_symbol *head;
- char* binding_label;
+ const char* binding_label;
int is_bind_c;
}
gfc_common_head;
gfc_try verify_bind_c_derived_type (gfc_symbol *);
gfc_try verify_com_block_vars_c_interop (gfc_common_head *);
void generate_isocbinding_symbol (const char *, iso_c_binding_symbol, const char *);
-gfc_symbol *get_iso_c_sym (gfc_symbol *, char *, char *, int);
+gfc_symbol *get_iso_c_sym (gfc_symbol *, char *, const char *, int);
int gfc_get_sym_tree (const char *, gfc_namespace *, gfc_symtree **, bool);
int gfc_get_ha_symbol (const char *, gfc_symbol **);
int gfc_get_ha_sym_tree (const char *, gfc_symtree **);
we successfully match a C name. */
match
-gfc_match_name_C (char **buffer)
+gfc_match_name_C (const char **buffer)
{
locus old_loc;
size_t i = 0;
match gfc_match_small_int (int *);
match gfc_match_small_int_expr (int *, gfc_expr **);
match gfc_match_name (char *);
-match gfc_match_name_C (char **buffer);
+match gfc_match_name_C (const char **buffer);
match gfc_match_symbol (gfc_symbol **, int);
match gfc_match_sym_tree (gfc_symtree **, int);
match gfc_match_intrinsic_op (gfc_intrinsic_op *);
static void
set_name_and_label (gfc_code *c, gfc_symbol *sym,
- char *name, char **binding_label)
+ char *name, const char **binding_label)
{
gfc_expr *arg = NULL;
char type;
gfc_symbol *new_sym;
/* this is fine, since we know the names won't use the max */
char name[GFC_MAX_SYMBOL_LEN + 1];
- char* binding_label;
+ const char* binding_label;
/* default to success; will override if find error */
match m = MATCH_YES;
gfc_symbol *
get_iso_c_sym (gfc_symbol *old_sym, char *new_name,
- char *new_binding_label, int add_optional_arg)
+ const char *new_binding_label, int add_optional_arg)
{
gfc_symtree *new_symtree = NULL;