Re: [PATCH] Fix type_info_expression()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Feb 1, 2009 at 11:31 PM, Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
> sizeof (typename){initializers}.foo is nice and valid C99 - it's parsed
> as sizeof primary.foo <- sizeof postfix.foo <- sizeof postfix <- sizeof unary
> <- unary.  Current type_info_expression() stops too early.

Thanks for the patch. Looks great.

> -       if (match_op(token, '{'))
> -               token = initializer(&expr->cast_expression, token);
> +       if (match_op(token, '{')) {
> +               struct expression *cast = alloc_expression(p->pos, EXPR_CAST);
> +               cast->cast_type = expr->cast_type;
> +               expr->cast_type = NULL;

Setting expr->cast_type = NULL here is not straightly necessary right?
The expr is EXPR_SIZEOF type, the expr->cast_type is not used in
evaluation_sizeof. Of course it doesn't hurt, I just want to get a confirm
that I understand it correct.y.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux