the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-
/* Process declarations and symbol lookup for C front end.
Also constructs types; the standard scalar types at initialization,
and structure, union, array and enum types when they are declared. */
/* Nonzero means make a BLOCK if this level has any subblocks. */
char keep_if_subblocks;
- /* Number of decls in `names' that have incomplete
+ /* Number of decls in `names' that have incomplete
structure or union types. */
int n_incomplete;
};
#define NULL_BINDING_LEVEL (struct binding_level *) NULL
-
+
/* The binding level currently in effect. */
static struct binding_level *current_binding_level;
if it has subblocks. */
static int keep_next_if_subblocks;
-
+
/* The chain of outer levels of label scopes.
This uses the same data structure used for binding levels,
but it works differently: each link in the chain records
int flag_signed_bitfields = 1;
int explicit_flag_signed_bitfields = 0;
-/* Nonzero means warn about use of implicit int. */
+/* Nonzero means warn about use of implicit int. */
int warn_implicit_int;
int warn_long_long = 1;
/* Nonzero means message about use of implicit function declarations;
- 1 means warning; 2 means error. */
+ 1 means warning; 2 means error. */
int mesg_implicit_function_declaration = -1;
int warn_bad_function_cast;
-/* Warn about functions which might be candidates for attribute noreturn. */
+/* Warn about functions which might be candidates for attribute noreturn. */
int warn_missing_noreturn;
/* Warn about #pragma directives that are not recognised. */
-int warn_unknown_pragmas = 0; /* Tri state variable. */
+int warn_unknown_pragmas = 0; /* Tri state variable. */
/* Warn about comparison of signed and unsigned values.
If -1, neither -Wsign-compare nor -Wno-sign-compare has been specified. */
int warn_sign_compare = -1;
-/* Warn about testing equality of floating point numbers. */
+/* Warn about testing equality of floating point numbers. */
int warn_float_equal = 0;
int warn_multichar = 1;
-/* Wrapper since C and C++ expand_expr_stmt are different. */
+/* Wrapper since C and C++ expand_expr_stmt are different. */
expand_expr_stmt_fn lang_expand_expr_stmt = c_expand_expr_stmt;
/* Decode the string P as a language-specific option for C.
Return the number of strings consumed. Should not complain
if it does not recognise the option. */
-
+
int
c_decode_option (argc, argv)
int argc ATTRIBUTE_UNUSED;
{
warn_implicit_int = 1;
if (mesg_implicit_function_declaration != 2)
- mesg_implicit_function_declaration = 1;
+ mesg_implicit_function_declaration = 1;
}
else if (!strcmp (p, "-Wno-implicit"))
warn_implicit_int = 0, mesg_implicit_function_declaration = 0;
\f
/* Hook called at end of compilation to assume 1 elt
for a top-level array decl that wasn't complete before. */
-
+
void
finish_incomplete_decl (decl)
tree decl;
\f
/* Create a new `struct binding_level'. */
-static
-struct binding_level *
+static struct binding_level *
make_binding_level ()
{
/* NOSTRICT */
keep_next_if_subblocks = 0;
}
-/* Clear the limbo values of all identifiers defined in BLOCK or a subblock. */
+/* Clear the limbo values of all identifiers defined in BLOCK or a subblock. */
static void
clear_limbo_values (block)
for (tem = BLOCK_SUBBLOCKS (block); tem; tem = TREE_CHAIN (tem))
clear_limbo_values (tem);
}
-
+
/* Exit a binding level.
Pop the level off, and restore the state of the identifier-decl mappings
that were in effect when this level was entered.
else if (block)
{
if (!block_previously_created)
- current_binding_level->blocks
- = chainon (current_binding_level->blocks, block);
+ current_binding_level->blocks
+ = chainon (current_binding_level->blocks, block);
}
/* If we did not make a block for the level just exited,
any blocks made for inner levels
cases, the TYPE_CONTEXTs of the relevant tagged type nodes get set
in `grokdeclarator' as soon as we have created the FUNCTION_TYPE
node which will represent the "scope" for these "parameter list local"
- tagged types.
- */
+ tagged types. */
if (functionbody)
for (link = tags; link; link = TREE_CHAIN (link))
DECL_NAME (TREE_VALUE (link)));
}
else if (warn_unused_label && !TREE_USED (TREE_VALUE (link)))
- warning_with_decl (TREE_VALUE (link),
+ warning_with_decl (TREE_VALUE (link),
"label `%s' defined but not used");
IDENTIFIER_LABEL_VALUE (DECL_NAME (TREE_VALUE (link))) = 0;
if (DECL_P (olddecl))
DECL_MACHINE_ATTRIBUTES (newdecl)
- = merge_machine_decl_attributes (olddecl, newdecl);
+ = merge_machine_decl_attributes (olddecl, newdecl);
if (TREE_CODE (newtype) == ERROR_MARK
|| TREE_CODE (oldtype) == ERROR_MARK)
"built-in function `%s' declared as non-function");
else
warning_with_decl (newdecl,
- "built-in function `%s' declared as non-function");
+ "built-in function `%s' declared as non-function");
}
else
{
}
else if (!types_match)
{
- /* Accept the return type of the new declaration if same modes. */
+ /* Accept the return type of the new declaration if same modes. */
tree oldreturntype = TREE_TYPE (oldtype);
tree newreturntype = TREE_TYPE (newtype);
- if (TYPE_MODE (oldreturntype) == TYPE_MODE (newreturntype))
- {
+ if (TYPE_MODE (oldreturntype) == TYPE_MODE (newreturntype))
+ {
/* Function types may be shared, so we can't just modify
the return type of olddecl's function type. */
tree trytype
= build_function_type (newreturntype,
TYPE_ARG_TYPES (oldtype));
-
+
types_match = comptypes (newtype, trytype);
if (types_match)
oldtype = trytype;
the return type of olddecl's function type. */
tree trytype
= build_function_type (TREE_TYPE (oldtype),
- tree_cons (NULL_TREE,
+ tree_cons (NULL_TREE,
TREE_VALUE (TYPE_ARG_TYPES (newtype)),
TREE_CHAIN (TYPE_ARG_TYPES (oldtype))));
-
- types_match = comptypes (newtype, trytype);
+
+ types_match = comptypes (newtype, trytype);
if (types_match)
oldtype = trytype;
}
: "`%s' previously declared here"));
}
else if (TREE_CODE (newdecl) == TYPE_DECL
- && (DECL_IN_SYSTEM_HEADER (olddecl)
+ && (DECL_IN_SYSTEM_HEADER (olddecl)
|| DECL_IN_SYSTEM_HEADER (newdecl)))
{
warning_with_decl (newdecl, "redefinition of `%s'");
- warning_with_decl
+ warning_with_decl
(olddecl,
((DECL_INITIAL (olddecl)
&& current_binding_level == global_binding_level)
if (TYPE_MAIN_VARIANT (TREE_VALUE (parm)) == void_type_node
|| TYPE_MAIN_VARIANT (TREE_VALUE (type)) == void_type_node)
{
- error_with_decl (newdecl, "prototype for `%s' follows and number of arguments doesn't match");
+ error_with_decl (newdecl,
+ "prototype for `%s' follows and number of arguments doesn't match");
error_with_decl (olddecl, "non-prototype definition here");
errmsg = 1;
break;
warning_with_decl (newdecl, "static declaration for `%s' follows non-static");
/* If warn_traditional, warn when a non-static function
- declaration follows a static one. */
+ declaration follows a static one. */
if (warn_traditional
&& TREE_CODE (olddecl) == FUNCTION_DECL
&& !TREE_PUBLIC (olddecl)
}
/* Merge the storage class information. */
- DECL_WEAK (newdecl) |= DECL_WEAK (olddecl);
+ DECL_WEAK (newdecl) |= DECL_WEAK (olddecl);
/* For functions, static overrides non-static. */
if (TREE_CODE (newdecl) == FUNCTION_DECL)
{
on a standard type by checking the current value of lineno. */
if (TREE_CODE (x) == TYPE_DECL)
- {
- if (DECL_SOURCE_LINE (x) == 0)
- {
+ {
+ if (DECL_SOURCE_LINE (x) == 0)
+ {
if (TYPE_NAME (TREE_TYPE (x)) == 0)
- TYPE_NAME (TREE_TYPE (x)) = x;
- }
- else if (TREE_TYPE (x) != error_mark_node
+ TYPE_NAME (TREE_TYPE (x)) = x;
+ }
+ else if (TREE_TYPE (x) != error_mark_node
&& DECL_ORIGINAL_TYPE (x) == NULL_TREE)
- {
- tree tt = TREE_TYPE (x);
+ {
+ tree tt = TREE_TYPE (x);
DECL_ORIGINAL_TYPE (x) = tt;
- tt = build_type_copy (tt);
- TYPE_NAME (tt) = x;
+ tt = build_type_copy (tt);
+ TYPE_NAME (tt) = x;
TREE_USED (tt) = TREE_USED (x);
- TREE_TYPE (x) = tt;
- }
- }
+ TREE_TYPE (x) = tt;
+ }
+ }
/* Multiple external decls of the same identifier ought to match.
Check against both global declarations (when traditional) and out of
if (b == global_binding_level)
{
/* Install a global value. */
-
+
/* If the first global decl has external linkage,
warn if we later see static one. */
if (IDENTIFIER_GLOBAL_VALUE (name) == 0 && TREE_PUBLIC (x))
}
}
-#if 0 /* This case is probably sometimes the right thing to do. */
+#if 0
+ /* This case is probably sometimes the right thing to do. */
/* If we have a local external declaration,
then any file-scope declaration should not
have been static. */
&& TREE_PUBLIC (x))
{
if (oldglobal == 0)
- TREE_PUBLIC (name) = 1;
+ TREE_PUBLIC (name) = 1;
/* Save this decl, so that we can do type checking against
other decls after it falls out of scope.
/* We used to reuse an old implicit decl here,
but this loses with inline functions because it can clobber
the saved decl chains. */
-/* if (IDENTIFIER_IMPLICIT_DECL (functionid) != 0)
+#if 0
+ if (IDENTIFIER_IMPLICIT_DECL (functionid) != 0)
decl = IDENTIFIER_IMPLICIT_DECL (functionid);
- else */
+ else
+#endif
decl = build_decl (FUNCTION_DECL, functionid, default_function_type);
/* Warn of implicit decl following explicit local extern decl.
is equivalent to what this code used to do before the build_type_copy
call. The variant type distinction should not matter for traditional
code, because it doesn't have type qualifiers. */
- if (flag_traditional
+ if (flag_traditional
&& TYPE_MAIN_VARIANT (TREE_TYPE (olddecl)) == TREE_TYPE (newdecl))
return 0;
if (DECL_IN_SYSTEM_HEADER (olddecl) || DECL_IN_SYSTEM_HEADER (newdecl))
for (dup = named_labels; dup; dup = TREE_CHAIN (dup))
if (TREE_VALUE (dup) == decl)
{
- error ("duplicate label declaration `%s'",
+ error ("duplicate label declaration `%s'",
IDENTIFIER_POINTER (name));
error_with_decl (TREE_VALUE (dup),
"this is a previous declaration");
if (warn_traditional && lookup_name (name))
warning ("traditional C lacks a separate namespace for labels, identifier `%s' conflicts",
IDENTIFIER_POINTER (name));
-
+
if (DECL_INITIAL (decl) != 0)
{
error ("duplicate label `%s'", IDENTIFIER_POINTER (name));
\f
/* Mark ARG for GC. */
-static void
+static void
mark_binding_level (arg)
void *arg;
{
named_labels = NULL;
current_binding_level = NULL_BINDING_LEVEL;
free_binding_level = NULL_BINDING_LEVEL;
- pushlevel (0); /* make the binding_level structure for global names */
+
+ /* Make the binding_level structure for global names. */
+ pushlevel (0);
global_binding_level = current_binding_level;
build_common_tree_nodes (flag_signed_char);
signed_size_type_node = signed_type (t);
if (flag_traditional && TREE_UNSIGNED (t))
t = signed_type (t);
-
+
set_sizetype (t);
- /* Create the widest literal types. */
+ /* Create the widest literal types. */
widest_integer_literal_type_node
= make_signed_type (HOST_BITS_PER_WIDE_INT * 2);
widest_unsigned_literal_type_node
= make_unsigned_type (HOST_BITS_PER_WIDE_INT * 2);
- pushdecl (build_decl (TYPE_DECL, NULL_TREE,
+ pushdecl (build_decl (TYPE_DECL, NULL_TREE,
widest_integer_literal_type_node));
- pushdecl (build_decl (TYPE_DECL, NULL_TREE,
+ pushdecl (build_decl (TYPE_DECL, NULL_TREE,
widest_unsigned_literal_type_node));
build_common_tree_nodes_2 (flag_short_double);
signed_wchar_type_node = signed_type (wchar_type_node);
unsigned_wchar_type_node = unsigned_type (wchar_type_node);
- wint_type_node = TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (get_identifier (WINT_TYPE)));
+ wint_type_node =
+ TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (get_identifier (WINT_TYPE)));
boolean_type_node = integer_type_node;
boolean_true_node = integer_one_node;
/* make a type for arrays of characters.
With luck nothing will ever really depend on the length of this
array type. */
- char_array_type_node
- = build_array_type (char_type_node, array_domain_type);
+ char_array_type_node = build_array_type (char_type_node, array_domain_type);
/* Likewise for arrays of ints. */
int_array_type_node
void_list_node = tree_cons (NULL_TREE, void_type_node, NULL_TREE);
- default_function_type
- = build_function_type (integer_type_node, NULL_TREE);
+ default_function_type = build_function_type (integer_type_node, NULL_TREE);
ptrdiff_type_node
= TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (get_identifier (PTRDIFF_TYPE)));
unsigned_ptrdiff_type_node = unsigned_type (ptrdiff_type_node);
tree_cons (NULL_TREE, ptr_type_node, endlink));
/* Types which are common to the fortran compiler and libf2c. When
- changing these, you also need to be concerned with f/com.h. */
+ changing these, you also need to be concerned with f/com.h. */
if (TYPE_PRECISION (float_type_node)
== TYPE_PRECISION (long_integer_type_node))
tree_cons (NULL_TREE, ptr_type_node,
tree_cons (NULL_TREE,
type_for_mode (ptr_mode, 0),
- tree_cons (NULL_TREE,
+ tree_cons (NULL_TREE,
ptr_type_node,
endlink)))),
BUILT_IN_EH_RETURN, BUILT_IN_NORMAL, NULL_PTR);
TREE_TYPE (init) = type;
DECL_INITIAL (decl) = init;
finish_decl (pushdecl (decl), init, NULL_TREE);
-
+
return decl;
}
NORMAL, initialized);
register tree tem;
- if (warn_main > 0 && TREE_CODE (decl) != FUNCTION_DECL
+ if (warn_main > 0 && TREE_CODE (decl) != FUNCTION_DECL
&& !strcmp (IDENTIFIER_POINTER (DECL_NAME (decl)), "main"))
warning_with_decl (decl, "`%s' is usually a function");
if (initialized)
{
-#if 0 /* Seems redundant with grokdeclarator. */
+#if 0
+ /* Seems redundant with grokdeclarator. */
if (current_binding_level != global_binding_level
&& DECL_EXTERNAL (decl)
&& TREE_CODE (decl) != FUNCTION_DECL)
error_with_decl (decl, "storage size of `%s' isn't constant");
}
- if (TREE_USED (type))
+ if (TREE_USED (type))
TREE_USED (decl) = 1;
}
builtin any more. Also reset DECL_RTL so we can give it its new
name. */
if (TREE_CODE (decl) == FUNCTION_DECL && asmspec)
- {
- DECL_BUILT_IN_CLASS (decl) = NOT_BUILT_IN;
- DECL_RTL (decl) = 0;
- DECL_ASSEMBLER_NAME (decl) = get_identifier (asmspec);
- }
+ {
+ DECL_BUILT_IN_CLASS (decl) = NOT_BUILT_IN;
+ DECL_RTL (decl) = 0;
+ DECL_ASSEMBLER_NAME (decl) = get_identifier (asmspec);
+ }
/* Output the assembler code and/or RTL code for variables and functions,
unless the type is an undefined structure or union.
tree olddecl;
olddecl = lookup_name (DECL_NAME (decl));
if (pedantic && olddecl != 0 && TREE_CODE (olddecl) == TYPE_DECL)
- pedwarn_with_decl (decl, "ANSI C forbids parameter `%s' shadowing typedef");
+ pedwarn_with_decl (decl,
+ "ANSI C forbids parameter `%s' shadowing typedef");
}
#endif
{
if (ridpointers[i] == id)
{
- if (i == (int) RID_LONG && specbits & (1<<i))
+ if (i == (int) RID_LONG && specbits & (1 << i))
{
if (longlong)
error ("`long long long' is too long for GCC");
else if (TREE_CODE (id) == TYPE_DECL)
{
type = TREE_TYPE (id);
- decl_machine_attr = DECL_MACHINE_ATTRIBUTES (id);
+ decl_machine_attr = DECL_MACHINE_ATTRIBUTES (id);
typedef_decl = id;
}
/* Built-in types come as identifiers. */
else if (TREE_CODE (id) != ERROR_MARK)
type = id;
- found: {}
+ found:
+ ;
}
typedef_type = type;
if ((warn_implicit_int || warn_return_type) && funcdef_flag)
warn_about_return_type = 1;
else if (warn_implicit_int || flag_isoc99)
- pedwarn_c99 ("type defaults to `int' in declaration of `%s'", name);
+ pedwarn_c99 ("type defaults to `int' in declaration of `%s'",
+ name);
}
defaulted_int = 1;
if ((specbits & 1 << (int) RID_LONG) && ! longlong
&& TYPE_MAIN_VARIANT (type) == double_type_node)
{
- specbits &= ~ (1 << (int) RID_LONG);
+ specbits &= ~(1 << (int) RID_LONG);
type = long_double_type_node;
}
&& TREE_CODE (type) != INTEGER_TYPE && TREE_CODE (type) != REAL_TYPE)
{
error ("complex invalid for `%s'", name);
- specbits &= ~ (1 << (int) RID_COMPLEX);
+ specbits &= ~(1 << (int) RID_COMPLEX);
}
/* Decide whether an integer type is signed or not.
error ("function definition declared `register'");
if (specbits & 1 << (int) RID_TYPEDEF)
error ("function definition declared `typedef'");
- specbits &= ~ ((1 << (int) RID_TYPEDEF) | (1 << (int) RID_REGISTER)
- | (1 << (int) RID_AUTO));
+ specbits &= ~((1 << (int) RID_TYPEDEF) | (1 << (int) RID_REGISTER)
+ | (1 << (int) RID_AUTO));
}
else if (decl_context != NORMAL && nclasses > 0)
{
switch (decl_context)
{
case FIELD:
- error ("storage class specified for structure field `%s'", name);
+ error ("storage class specified for structure field `%s'",
+ name);
break;
case PARM:
error ("storage class specified for parameter `%s'", name);
error ("storage class specified for typename");
break;
}
- specbits &= ~ ((1 << (int) RID_TYPEDEF) | (1 << (int) RID_REGISTER)
- | (1 << (int) RID_AUTO) | (1 << (int) RID_STATIC)
- | (1 << (int) RID_EXTERN));
+ specbits &= ~((1 << (int) RID_TYPEDEF) | (1 << (int) RID_REGISTER)
+ | (1 << (int) RID_AUTO) | (1 << (int) RID_STATIC)
+ | (1 << (int) RID_EXTERN));
}
}
else if (specbits & 1 << (int) RID_EXTERN && initialized && ! funcdef_flag)
if (pedantic)
{
if (TREE_CONSTANT (size))
- pedwarn ("ISO C89 forbids array `%s' whose size can't be evaluated", name);
+ pedwarn ("ISO C89 forbids array `%s' whose size can't be evaluated",
+ name);
else
- pedwarn ("ISO C89 forbids variable-size array `%s'", name);
+ pedwarn ("ISO C89 forbids variable-size array `%s'",
+ name);
}
}
itype = build_index_type (itype);
}
-#if 0 /* This had bad results for pointers to arrays, as in
- union incomplete (*foo)[4]; */
+#if 0
+ /* This had bad results for pointers to arrays, as in
+ union incomplete (*foo)[4]; */
/* Complain about arrays of incomplete types, except in typedefs. */
if (!COMPLETE_TYPE_P (type)
warning ("array type has incomplete element type");
#endif
-#if 0 /* We shouldn't have a function type here at all!
- Functions aren't allowed as array elements. */
+#if 0
+ /* We shouldn't have a function type here at all!
+ Functions aren't allowed as array elements. */
if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
&& (constp || volatilep))
pedwarn ("ANSI C forbids const or volatile function types");
if (type_quals)
type = c_build_qualified_type (type, type_quals);
-#if 0 /* don't clear these; leave them set so that the array type
- or the variable is itself const or volatile. */
+#if 0
+ /* Don't clear these; leave them set so that the array type
+ or the variable is itself const or volatile. */
type_quals = TYPE_UNQUALIFIED;
#endif
type = build_array_type (c_build_qualified_type (TREE_TYPE (type),
type_quals),
TYPE_DOMAIN (type));
-#if 0 /* Leave the field const or volatile as well. */
+#if 0
+ /* Leave the field const or volatile as well. */
type_quals = TYPE_UNQUALIFIED;
#endif
}
TREE_TYPE (parm) = error_mark_node;
}
}
-#if 0 /* This has been replaced by parm_tags_warning
- which uses a more accurate criterion for what to warn about. */
+#if 0
+ /* This has been replaced by parm_tags_warning, which
+ uses a more accurate criterion for what to warn
+ about. */
else
{
/* Now warn if is a pointer to an incomplete type. */
typelt = TREE_CHAIN (typelt);
}
- return first_parm;
+ return first_parm;
}
}
-
/* Return a tree_list node with info on a parameter list just parsed.
The TREE_PURPOSE is a chain of decls of those parms.
The TREE_VALUE is a list of structure, union and enum tags defined.
But if the `void' is qualified (by `const' or `volatile') or has a
storage class specifier (`register'), then the behavior is undefined;
by not counting it as the special case of `void' we will cause an
- error later. Typedefs for `void' are OK (see DR#157).
- */
+ error later. Typedefs for `void' are OK (see DR#157). */
if (void_at_end && parms != 0
&& TREE_CHAIN (parms) == 0
&& VOID_TYPE_P (TREE_TYPE (parms))
/* Extract enumerator values and other non-parms declared with the parms.
Likewise any forward parm decls that didn't have real parm decls. */
- for (decl = parms; decl; )
+ for (decl = parms; decl;)
{
tree next = TREE_CHAIN (decl);
}
else if (TREE_ASM_WRITTEN (decl))
{
- error_with_decl (decl, "parameter `%s' has just a forward declaration");
+ error_with_decl (decl,
+ "parameter `%s' has just a forward declaration");
TREE_CHAIN (decl) = new_parms;
new_parms = decl;
}
: "enum"),
IDENTIFIER_POINTER (TREE_PURPOSE (elt)));
else
- {
- /* For translation these need to be seperate warnings */
- if (code == RECORD_TYPE)
+ {
+ /* For translation these need to be seperate warnings */
+ if (code == RECORD_TYPE)
warning ("anonymous struct declared inside parameter list");
else if (code == UNION_TYPE)
warning ("anonymous union declared inside parameter list");
- else
+ else
warning ("anonymous enum declared inside parameter list");
}
if (! already)
{
if (tree_int_cst_sgn (DECL_INITIAL (x)) < 0)
error_with_decl (x, "negative width in bit-field `%s'");
- else if (0 < compare_tree_int (DECL_INITIAL (x),
+ else if (0 < compare_tree_int (DECL_INITIAL (x),
TYPE_PRECISION (TREE_TYPE (x))))
pedwarn_with_decl (x, "width of `%s' exceeds its type");
else if (integer_zerop (DECL_INITIAL (x)) && DECL_NAME (x) != 0)
else
{
register tree y = fieldlist;
-
+
while (1)
{
if (DECL_NAME (y) == DECL_NAME (TREE_CHAIN (x)))
error_with_decl (TREE_CHAIN (x), "duplicate member `%s'");
TREE_CHAIN (x) = TREE_CHAIN (TREE_CHAIN (x));
}
- else x = TREE_CHAIN (x);
+ else
+ x = TREE_CHAIN (x);
}
/* Now we have the nearly final fieldlist. Record it,
&& old_decl != 0 && TREE_USED (old_decl)
&& TYPE_ARG_TYPES (TREE_TYPE (old_decl)) == 0)
warning_with_decl (decl1,
- "`%s' was used with no prototype before its definition");
+ "`%s' was used with no prototype before its definition");
/* Optionally warn of any global def with no previous declaration. */
else if (warn_missing_declarations
&& TREE_PUBLIC (decl1)
&& old_decl != 0 && TREE_USED (old_decl)
&& old_decl == IDENTIFIER_IMPLICIT_DECL (DECL_NAME (decl1)))
warning_with_decl (decl1,
- "`%s' was used with no declaration before its definition");
+ "`%s' was used with no declaration before its definition");
/* This is a definition, not a reference.
So normally clear DECL_EXTERNAL.
#ifdef SET_DEFAULT_DECL_ATTRIBUTES
SET_DEFAULT_DECL_ATTRIBUTES (decl1, attributes);
#endif
-
+
/* This function exists in static storage.
(This does not mean `static' in the C sense!) */
TREE_STATIC (decl1) = 1;
if (current_function_decl != 0)
TREE_PUBLIC (decl1) = 0;
- /* Warn for unlikely, improbable, or stupid declarations of `main'. */
+ /* Warn for unlikely, improbable, or stupid declarations of `main'. */
if (warn_main > 0
&& strcmp ("main", IDENTIFIER_POINTER (DECL_NAME (decl1))) == 0)
{
int argct = 0;
if (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (decl1)))
- != integer_type_node)
+ != integer_type_node)
pedwarn_with_decl (decl1, "return type of `%s' is not `int'");
for (args = TYPE_ARG_TYPES (TREE_TYPE (decl1)); args;
|| (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (type)))
!= char_type_node))
pedwarn_with_decl (decl1,
- "second argument of `%s' should be `char **'");
+ "second argument of `%s' should be `char **'");
break;
case 3:
|| (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (type)))
!= char_type_node))
pedwarn_with_decl (decl1,
- "third argument of `%s' should probably be `char **'");
+ "third argument of `%s' should probably be `char **'");
break;
}
}
/* It is intentional that this message does not mention the third
argument, which is warned for only pedantically, because it's
- blessed by mention in an appendix of the standard. */
+ blessed by mention in an appendix of the standard. */
if (argct > 0 && (argct < 2 || argct > 3))
pedwarn_with_decl (decl1, "`%s' takes only zero or two arguments");
won't depend on its type. */
TREE_TYPE (dummy) = integer_type_node;
DECL_ARG_TYPE (dummy) = integer_type_node;
- DECL_ARGUMENTS (fndecl)
- = chainon (DECL_ARGUMENTS (fndecl), dummy);
+ DECL_ARGUMENTS (fndecl) = chainon (DECL_ARGUMENTS (fndecl), dummy);
}
#endif
TREE_PURPOSE (parm) = found;
- /* Mark this decl as "already found" */
+ /* Mark this decl as "already found". */
DECL_WEAK (found) = 1;
}
any actual PARM_DECLs not matched with any names. */
nonparms = 0;
- for (parm = parmdecls; parm; )
+ for (parm = parmdecls; parm;)
{
tree next = TREE_CHAIN (parm);
TREE_CHAIN (parm) = 0;
{
/* Complain about args with incomplete types. */
if (!COMPLETE_TYPE_P (TREE_TYPE (parm)))
- {
- error_with_decl (parm, "parameter `%s' has incomplete type");
- TREE_TYPE (parm) = error_mark_node;
- }
+ {
+ error_with_decl (parm, "parameter `%s' has incomplete type");
+ TREE_TYPE (parm) = error_mark_node;
+ }
if (! DECL_WEAK (parm))
- {
- error_with_decl (parm,
- "declaration for parameter `%s' but no such parameter");
+ {
+ error_with_decl (parm,
+ "declaration for parameter `%s' but no such parameter");
/* Pretend the parameter was not missing.
This gets us to a standard state and minimizes
further error messages. */
- specparms
+ specparms
= chainon (specparms,
tree_cons (parm, NULL_TREE, NULL_TREE));
}
parm = next;
}
- /* Chain the declarations together in the order of the list of names. */
- /* Store that chain in the function decl, replacing the list of names. */
+ /* Chain the declarations together in the order of the list of
+ names. Store that chain in the function decl, replacing the
+ list of names. */
parm = specparms;
DECL_ARGUMENTS (fndecl) = 0;
{
/* Complain about any actual PARM_DECLs not matched with any names. */
- for (parm = parmdecls; parm; )
+ for (parm = parmdecls; parm;)
{
tree next = TREE_CHAIN (parm);
TREE_CHAIN (parm) = 0;
types = tree_cons (NULL_TREE, TREE_TYPE (parm), types);
}
}
-
+
if (void_at_end)
return tree_cons (parmdecls, nonparms,
nreverse (tree_cons (NULL_TREE, void_type_node, types)));
!= integer_type_node)
{
/* If warn_main is 1 (-Wmain) or 2 (-Wall), we have already warned.
- If warn_main is -1 (-Wno-main) we don't want to be warned. */
+ If warn_main is -1 (-Wno-main) we don't want to be warned. */
if (! warn_main)
pedwarn_with_decl (fndecl, "return type of `%s' is not `int'");
}
size_as_int);
else
warning_with_decl (fndecl,
- "size of return value of `%s' is larger than %d bytes",
+ "size of return value of `%s' is larger than %d bytes",
larger_than_size);
}
}
if (DECL_SAVED_INSNS (fndecl) == 0 && ! nested)
{
- /* Stop pointing to the local nodes about to be freed.
+ /* Stop pointing to the local nodes about to be freed.
But DECL_INITIAL must remain nonzero so we know this
- was an actual function definition.
+ was an actual function definition.
For a nested function, this is done in pop_c_function_context.
If rest_of_compilation set this to 0, leave it 0. */
if (DECL_INITIAL (fndecl) != 0)
static_ctors = tree_cons (NULL_TREE, fndecl, static_ctors);
else
#endif
- assemble_constructor (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl)));
+ assemble_constructor (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl)));
}
if (DECL_STATIC_DESTRUCTOR (fndecl))
}
/* Mark the language specific parts of F for GC. */
+
void
mark_c_function_context (f)
struct function *f;
}
/* Mark ARG for GC. */
+
void
lang_mark_false_label_stack (arg)
struct label_node *arg;
{
/* C doesn't use false_label_stack. It better be NULL. */
if (arg != NULL)
- abort();
+ abort ();
}
/* Mark the language specific bits in T for GC. */
+
void
lang_mark_tree (t)
tree t;
/* The functions below are required for functionality of doing
function at once processing in the C front end. Currently these
functions are not called from anywhere in the C front end, but as
- these changes continue, that will change. */
+ these changes continue, that will change. */
/* Returns non-zero if the current statement is a full expression,
i.e. temporaries created during that statement should be destroyed
}
/* Nonzero if TYPE is an anonymous union or struct type. Always 0 in
- C. */
+ C. */
-int
+int
anon_aggr_type_p (node)
tree node ATTRIBUTE_UNUSED;
{
return 0;
}
-/* Code to generate the RTL for a case label in C. */
+/* Code to generate the RTL for a case label in C. */
void
do_case (low_value, high_value)
value2 = check_case_value (high_value);
label = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
-
+
if (pedantic && (high_value != NULL_TREE))
pedwarn ("ISO C forbids case ranges");
{
tree duplicate;
int success;
-
+
if (high_value == NULL_TREE && value1 != NULL_TREE &&
pedantic && ! INTEGRAL_TYPE_P (TREE_TYPE (value1)))
pedwarn ("label must have integral type in ISO C");
-
+
if (low_value == NULL_TREE)
success = pushcase (NULL_TREE, 0, label, &duplicate);
else if (high_value == NULL_TREE)
- success = pushcase (value1, convert_and_check, label,
- &duplicate);
+ success = pushcase (value1, convert_and_check, label, &duplicate);
else
success = pushcase_range (value1, value2, convert_and_check,
label, &duplicate);
-
+
if (success == 1)
{
if (low_value == NULL_TREE)
else
error ("case label not within a switch statement");
}
- else if (success == 2) {
- if (low_value == NULL_TREE)
- {
- error ("multiple default labels in one switch");
- error_with_decl (duplicate, "this is the first default label");
- }
- else
- error ("dupicate case value");
- if (high_value != NULL_TREE)
- error_with_decl (duplicate, "this is the first entry for that value");
- }
- else if (low_value != NULL_TREE)
+ else if (success == 2)
+ {
+ if (low_value == NULL_TREE)
+ {
+ error ("multiple default labels in one switch");
+ error_with_decl (duplicate, "this is the first default label");
+ }
+ else
+ error ("dupicate case value");
+ if (high_value != NULL_TREE)
+ error_with_decl (duplicate,
+ "this is the first entry for that value");
+ }
+ else if (low_value != NULL_TREE)
{
if (success == 3)
warning ("case value out of range");
}
/* Language specific handler of tree nodes used when generating RTL
- from a tree. */
+ from a tree. */
tree
lang_expand_stmt (t)
return NULL_TREE;
}
-/* Accessor to set the 'current_function_name_declared' flag. */
+/* Accessor to set the 'current_function_name_declared' flag. */
void
set_current_function_name_declared (i)
{
abort ();
}
-