This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 05/10] vla: allow side effects for sizeof argument
- From: Tom Tromey <tromey at redhat dot com>
- To: "Agovic\, Sanimir" <sanimir dot agovic at intel dot com>
- Cc: "gdb-patches\ at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 18 Nov 2013 08:53:18 -0700
- Subject: Re: [PATCH 05/10] vla: allow side effects for sizeof argument
- Authentication-results: sourceware.org; auth=none
- References: <1382366424-21010-1-git-send-email-sanimir dot agovic at intel dot com> <1382366424-21010-6-git-send-email-sanimir dot agovic at intel dot com> <87d2mua1gi dot fsf at fleche dot redhat dot com> <0377C58828D86C4588AEEC42FC3B85A71769F292 at IRSMSX105 dot ger dot corp dot intel dot com> <87ppqp9kme dot fsf at fleche dot redhat dot com> <0377C58828D86C4588AEEC42FC3B85A7176B5F16 at IRSMSX105 dot ger dot corp dot intel dot com>
>>>>> "Sanimir" == Agovic, Sanimir <sanimir.agovic@intel.com> writes:
Sanimir> It turns out this patch is not needed anymore as the bounds are
Sanimir> resolved before the sizeof function is called. So in v2 this
Sanimir> patch will be dropped from the series.
Tom> (gdb) print sizeof (array[x++])
Tom> For an ordinary array this should not modify x.
Sanimir> Indeed, that is the behavior we have now in HEAD@vla-c99.
I thought sizeof with a vla as an argument had to evaluate its argument.
So it seems that the above may yield incorrect semantics in some other
test case.
Tom