This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Array subscript has type 'char' and constant expressions
On Thu, Mar 13, 2003 at 12:07:27PM +0100, Andreas Schwab wrote:
> |> Is there some good reason why this warning does not check
> |> against tree_expr_nonnegative_p ? Wouldn't this fix the warning about
> |> array['a'] (assuming that the constant 'a' is non-negative of course) ?
>
> 'a' is of type int, so I can't see how it can provoke the warning.
Not in C++. Try it :
int main()
{
int x[4];
x['a'] = 1;
}
john