scope->depth--;
sorry ("GCC supports only %u nested scopes\n", scope->depth);
}
-
+
current_scope = scope;
keep_next_level_flag = false;
}
/* Labels go in BLOCK_VARS. */
TREE_CHAIN (p) = BLOCK_VARS (block);
BLOCK_VARS (block) = p;
-
+
#ifdef ENABLE_CHECKING
if (I_LABEL_BINDING (b->id) != b) abort ();
#endif
}
}
-
+
/* Dispose of the block that we just made inside some higher level. */
if ((scope->function_body || scope == file_scope) && context)
{
}
else
{
- error ("%Jconflicting types for '%D'", newdecl, newdecl);
+ if (TYPE_QUALS (newtype) != TYPE_QUALS (oldtype))
+ error ("%J conflicting type qualifiers for '%D'", newdecl, newdecl);
+ else
+ error ("%Jconflicting types for '%D'", newdecl, newdecl);
diagnose_arglist_conflict (newdecl, olddecl, newtype, oldtype);
locate_old_decl (olddecl, error);
return false;
{
if (DECL_IN_SYSTEM_HEADER (newdecl) || DECL_IN_SYSTEM_HEADER (olddecl))
return true; /* Allow OLDDECL to continue in use. */
-
+
error ("%Jredefinition of typedef '%D'", newdecl, newdecl);
locate_old_decl (olddecl, error);
return false;
/* Discard the old built-in function. */
return false;
}
-
+
if (DECL_INITIAL (newdecl))
{
if (DECL_INITIAL (olddecl)
locate_old_decl (olddecl, error);
return false;
}
-
- /* These bits are only type qualifiers when applied to objects. */
- if (TREE_THIS_VOLATILE (newdecl) != TREE_THIS_VOLATILE (olddecl))
- {
- if (TREE_THIS_VOLATILE (newdecl))
- pedwarn ("%Jvolatile declaration of '%D' follows "
- "non-volatile declaration", newdecl, newdecl);
- else
- pedwarn ("%Jnon-volatile declaration of '%D' follows "
- "volatile declaration", newdecl, newdecl);
- pedwarned = true;
- }
- if (TREE_READONLY (newdecl) != TREE_READONLY (olddecl))
- {
- if (TREE_READONLY (newdecl))
- pedwarn ("%Jconst declaration of '%D' follows "
- "non-const declaration", newdecl, newdecl);
- else
- pedwarn ("%Jnon-const declaration of '%D' follows "
- "const declaration", newdecl, newdecl);
- pedwarned = true;
- }
}
/* Optional warning for completely redundant decls. */
merge_decls (newdecl, olddecl, newtype, oldtype);
return true;
}
-
+
\f
/* Check whether decl-node NEW shadows an existing declaration. */
static void
/* For our purposes, a tag in the external scope is the same as
a tag in the file scope. (Primarily relevant to Objective-C
and its builtin structure tags, which get pushed before the
- file scope is created.) */
+ file scope is created.) */
if (b->contour == current_scope
|| (current_scope == file_scope && b->contour == external_scope))
thislevel = 1;
if (TREE_CODE (*type) == ENUMERAL_TYPE)
{
struct lang_type *lt = TYPE_LANG_SPECIFIC (*type);
- if (!lt
+ if (!lt
|| w < min_precision (lt->enum_min, TYPE_UNSIGNED (*type))
|| w < min_precision (lt->enum_max, TYPE_UNSIGNED (*type)))
warning ("`%s' is narrower than values of its type", name);
/* The %s will be one of 'struct', 'union', or 'enum'. */
warning ("anonymous %s declared inside parameter list",
keyword);
-
+
if (! explained_incomplete_types)
{
warning ("its scope is only this definition or declaration,"
/* Genericize before inlining. Delay genericizing nested functions
until their parent function is genericized. Since finalizing
requires GENERIC, delay that as well. */
-
+
if (DECL_INITIAL (fndecl) && DECL_INITIAL (fndecl) != error_mark_node)
{
if (!decl_function_context (fndecl))
tree *vec = xmalloc (sizeof (tree) * len);
size_t i;
tree decl;
-
+
/* Process the decls in the order they were written. */
for (i = 0, decl = globals; i < len; i++, decl = TREE_CHAIN (decl))
vec[i] = decl;
wrapup_global_declarations (vec, len);
check_global_declarations (vec, len);
-
+
free (vec);
}