Commit f9551830 by Ian Lance Taylor Committed by Ian Lance Taylor

* c-decl.c (grokdeclarator): Change size_varies to bool.

From-SVN: r148550
parent c32e2175
2009-06-16 Ian Lance Taylor <iant@google.com> 2009-06-16 Ian Lance Taylor <iant@google.com>
* c-decl.c (grokdeclarator): Change size_varies to bool.
2009-06-16 Ian Lance Taylor <iant@google.com>
* sel-sched.c: Make forward declarations of move_op_hooks and * sel-sched.c: Make forward declarations of move_op_hooks and
fur_hooks explicitly extern. fur_hooks explicitly extern.
......
...@@ -4713,7 +4713,7 @@ grokdeclarator (const struct c_declarator *declarator, ...@@ -4713,7 +4713,7 @@ grokdeclarator (const struct c_declarator *declarator,
tree name = NULL_TREE; tree name = NULL_TREE;
bool funcdef_flag = false; bool funcdef_flag = false;
bool funcdef_syntax = false; bool funcdef_syntax = false;
int size_varies = 0; bool size_varies = false;
tree decl_attr = declspecs->decl_attr; tree decl_attr = declspecs->decl_attr;
int array_ptr_quals = TYPE_UNQUALIFIED; int array_ptr_quals = TYPE_UNQUALIFIED;
tree array_ptr_attrs = NULL_TREE; tree array_ptr_attrs = NULL_TREE;
...@@ -4807,7 +4807,7 @@ grokdeclarator (const struct c_declarator *declarator, ...@@ -4807,7 +4807,7 @@ grokdeclarator (const struct c_declarator *declarator,
type = integer_type_node; type = integer_type_node;
} }
size_varies = C_TYPE_VARIABLE_SIZE (type); size_varies = C_TYPE_VARIABLE_SIZE (type) != 0;
/* Diagnose defaulting to "int". */ /* Diagnose defaulting to "int". */
...@@ -5140,7 +5140,7 @@ grokdeclarator (const struct c_declarator *declarator, ...@@ -5140,7 +5140,7 @@ grokdeclarator (const struct c_declarator *declarator,
"variably modified %qE at file scope", "variably modified %qE at file scope",
name); name);
else else
this_size_varies = size_varies = 1; this_size_varies = size_varies = true;
warn_variable_length_array (name, size); warn_variable_length_array (name, size);
} }
} }
...@@ -5155,7 +5155,7 @@ grokdeclarator (const struct c_declarator *declarator, ...@@ -5155,7 +5155,7 @@ grokdeclarator (const struct c_declarator *declarator,
/* Make sure the array size remains visibly /* Make sure the array size remains visibly
nonconstant even if it is (eg) a const variable nonconstant even if it is (eg) a const variable
with known value. */ with known value. */
this_size_varies = size_varies = 1; this_size_varies = size_varies = true;
warn_variable_length_array (name, size); warn_variable_length_array (name, size);
} }
...@@ -5227,7 +5227,7 @@ grokdeclarator (const struct c_declarator *declarator, ...@@ -5227,7 +5227,7 @@ grokdeclarator (const struct c_declarator *declarator,
the field variably modified, not through being the field variably modified, not through being
something other than a declaration with function something other than a declaration with function
prototype scope. */ prototype scope. */
size_varies = 1; size_varies = true;
else else
{ {
const struct c_declarator *t = declarator; const struct c_declarator *t = declarator;
...@@ -5251,7 +5251,7 @@ grokdeclarator (const struct c_declarator *declarator, ...@@ -5251,7 +5251,7 @@ grokdeclarator (const struct c_declarator *declarator,
if (array_parm_vla_unspec_p) if (array_parm_vla_unspec_p)
{ {
itype = build_range_type (sizetype, size_zero_node, NULL_TREE); itype = build_range_type (sizetype, size_zero_node, NULL_TREE);
size_varies = 1; size_varies = true;
} }
} }
else if (decl_context == TYPENAME) else if (decl_context == TYPENAME)
...@@ -5265,7 +5265,7 @@ grokdeclarator (const struct c_declarator *declarator, ...@@ -5265,7 +5265,7 @@ grokdeclarator (const struct c_declarator *declarator,
otherwise be modified below. */ otherwise be modified below. */
itype = build_range_type (sizetype, size_zero_node, itype = build_range_type (sizetype, size_zero_node,
NULL_TREE); NULL_TREE);
size_varies = 1; size_varies = true;
} }
} }
...@@ -5349,7 +5349,7 @@ grokdeclarator (const struct c_declarator *declarator, ...@@ -5349,7 +5349,7 @@ grokdeclarator (const struct c_declarator *declarator,
if (type == error_mark_node) if (type == error_mark_node)
continue; continue;
size_varies = 0; size_varies = false;
/* Warn about some types functions can't return. */ /* Warn about some types functions can't return. */
if (TREE_CODE (type) == FUNCTION_TYPE) if (TREE_CODE (type) == FUNCTION_TYPE)
...@@ -5434,7 +5434,7 @@ grokdeclarator (const struct c_declarator *declarator, ...@@ -5434,7 +5434,7 @@ grokdeclarator (const struct c_declarator *declarator,
"ISO C forbids qualified function types"); "ISO C forbids qualified function types");
if (type_quals) if (type_quals)
type = c_build_qualified_type (type, type_quals); type = c_build_qualified_type (type, type_quals);
size_varies = 0; size_varies = false;
/* When the pointed-to type involves components of variable size, /* When the pointed-to type involves components of variable size,
care must be taken to ensure that the size evaluation code is care must be taken to ensure that the size evaluation code is
...@@ -5620,7 +5620,7 @@ grokdeclarator (const struct c_declarator *declarator, ...@@ -5620,7 +5620,7 @@ grokdeclarator (const struct c_declarator *declarator,
warning_at (loc, OPT_Wattributes, warning_at (loc, OPT_Wattributes,
"attributes in parameter array declarator ignored"); "attributes in parameter array declarator ignored");
size_varies = 0; size_varies = false;
} }
else if (TREE_CODE (type) == FUNCTION_TYPE) else if (TREE_CODE (type) == FUNCTION_TYPE)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment