This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: More traditional fallout
On Wed, Feb 27, 2002 at 03:45:29PM -0800, Zack Weinberg wrote:
> On Wed, Feb 27, 2002 at 10:21:32PM +0000, Joseph S. Myers wrote:
> > On Wed, 27 Feb 2002, Zack Weinberg wrote:
> >
> > > c-typeck.c::digest_init()'s last parameter was only used if
> > > -traditional.
> >
> > What's this to do with -traditional? I thought it wasn't used anyway
> > (except to be passed as the same parameter in a nested call),
>
> ... inside a block conditioned on flag_traditional.
>
> I don't know what it was for, either.
I don't know either.
Just can make a guess from what used to be in gcc 2.95.x/2.96:
digest_init:
else if (require_constant && ! TREE_CONSTANT (inside_init))
{
error_init ("initializer element is not constant");
inside_init = error_mark_node;
}
else if (require_constant
&& initializer_constant_valid_p (inside_init, TREE_TYPE (inside_init)) == 0)
{
error_init ("initializer element is not computable at load time");
inside_init = error_mark_node;
}
output_init_element:
if (require_constant_value && ! TREE_CONSTANT (value))
{
error_init ("initializer element is not constant");
value = error_mark_node;
}
else if (require_constant_elements
&& initializer_constant_valid_p (value, TREE_TYPE (value)) == 0)
{
error_init ("initializer element is not computable at load time");
value = error_mark_node;
}
As require_constant_value is what is usually passed to
require_constant and require_constant_elements usually passed to
constructor_constants and from similarities in both error messages,
I think either at some time digest_init used constructor_constant instead
of require_constant together with initializer_constant_valid_p, or
it ought to but never did actually.
Jakub